# Backblaze B2 MCP Server

Backblaze's official MCP server puts B2 storage in your agent's hands: buckets, objects, application keys, Object Lock. Handy when you want to inspect a bucket or push a file without leaving the chat.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 45
- Author: backblaze-labs
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/backblaze-labs/b2-mcp
- Updated: 2026-10-24
- HTML: https://affpapa.org/en/nevibecode/mcp/backblaze-b2-mcp-server

## What it does

The server ships 40 tools. Seventeen go through the native B2 SDK and cover control-plane work the S3 API cannot do: buckets, application keys, Object Lock, event notifications, Partner/Groups. Nineteen use the AWS S3 SDK for the data plane — uploading, downloading, copying, listing and deleting objects, multipart transfers, presigned URLs. Four more are custom MCP code that computes reports over B2 data: storage growth, top egress, biggest files, abandoned uploads.

Destructive calls are gated. B2 secrets stay away from the model context under the default, file and off modes. Tool registration follows the key's capabilities, so a key only sees what it can actually do. Read-only resources are exposed too: `b2://server-config`, plus capability-gated `b2://capabilities` and `b2://bucket/{bucketName}`.

You need a Node.js runtime in the `^22.22.2 || ^24 || ^26` range and a B2 application key. A non-master key is enough for storage, S3 and key management. Partner/Groups tools throw without `B2_MASTER_KEY_ID` and `B2_MASTER_KEY`. Add `B2_REGION` when the region has to be known before authorization.

## Requirements
- Needs: Node.js (commands run via npx)
- Environment variables: `B2_APPLICATION_KEY_ID`, `B2_APPLICATION_KEY`, `B2_REGION`, `B2_MASTER_KEY_ID`, `B2_MASTER_KEY` — keys and tokens: ask the human for the values, never commit them or put them in shared files.

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add --env B2_APPLICATION_KEY_ID=<B2_APPLICATION_KEY_ID> --env B2_APPLICATION_KEY=<B2_APPLICATION_KEY> --env B2_REGION=<B2_REGION> --env B2_MASTER_KEY_ID=<B2_MASTER_KEY_ID> --env B2_MASTER_KEY=<B2_MASTER_KEY> --transport stdio backblaze-b2-mcp-server -- npx -y @backblaze-labs/b2-mcp
```
Replace <…> with your own values

### Codex

**Platform CLI**
```bash
codex mcp add backblaze-b2-mcp-server --env B2_APPLICATION_KEY_ID=<B2_APPLICATION_KEY_ID> --env B2_APPLICATION_KEY=<B2_APPLICATION_KEY> --env B2_REGION=<B2_REGION> --env B2_MASTER_KEY_ID=<B2_MASTER_KEY_ID> --env B2_MASTER_KEY=<B2_MASTER_KEY> -- npx -y @backblaze-labs/b2-mcp
```
Replace <…> with your own values

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "backblaze-b2-mcp-server": {
            "command": "npx",
            "args": [
                "-y",
                "@backblaze-labs/b2-mcp"
            ],
            "env": {
                "B2_APPLICATION_KEY_ID": "<B2_APPLICATION_KEY_ID>",
                "B2_APPLICATION_KEY": "<B2_APPLICATION_KEY>",
                "B2_REGION": "<B2_REGION>",
                "B2_MASTER_KEY_ID": "<B2_MASTER_KEY_ID>",
                "B2_MASTER_KEY": "<B2_MASTER_KEY>"
            }
        }
    }
}
```
Replace <…> with your own values

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "backblaze-b2-mcp-server": {
            "type": "stdio",
            "command": "npx",
            "args": [
                "-y",
                "@backblaze-labs/b2-mcp"
            ],
            "env": {
                "B2_APPLICATION_KEY_ID": "<B2_APPLICATION_KEY_ID>",
                "B2_APPLICATION_KEY": "<B2_APPLICATION_KEY>",
                "B2_REGION": "<B2_REGION>",
                "B2_MASTER_KEY_ID": "<B2_MASTER_KEY_ID>",
                "B2_MASTER_KEY": "<B2_MASTER_KEY>"
            }
        }
    }
}
```
Replace <…> with your own values

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add -e B2_APPLICATION_KEY_ID=<B2_APPLICATION_KEY_ID> -e B2_APPLICATION_KEY=<B2_APPLICATION_KEY> -e B2_REGION=<B2_REGION> -e B2_MASTER_KEY_ID=<B2_MASTER_KEY_ID> -e B2_MASTER_KEY=<B2_MASTER_KEY> backblaze-b2-mcp-server npx -y @backblaze-labs/b2-mcp
```
Replace <…> with your own values

## When to use it
- list every bucket in a B2 account
- upload or pull an object over the S3-compatible API
- find the biggest files in a bucket
- check which uploads were never finished
- issue an application key with narrow rights

## Example prompts
- List the buckets in my Backblaze B2 account and show the Object Lock settings on each
- Upload `report.pdf` to the `archive` bucket through the S3-compatible endpoint
- Run the B2 report: how much did storage grow and which files drive egress

## Similar
- [mcp-server](https://affpapa.org/en/nevibecode/mcp/mcp-server.md) — MCP server · ★ 43872
- [Coder](https://affpapa.org/en/nevibecode/mcp/coder.md) — MCP server · ★ 17160
- [firebase-mcp](https://affpapa.org/en/nevibecode/mcp/firebase-mcp.md) — MCP server · ★ 4481
- [Radar Kubernetes MCP Server](https://affpapa.org/en/nevibecode/mcp/radar-kubernetes-mcp-server.md) — MCP server · ★ 3905
- [Supabase](https://affpapa.org/en/nevibecode/mcp/supabase.md) — MCP server · ★ 2969
- [Microsoft Fabric MCP Server](https://affpapa.org/en/nevibecode/mcp/microsoft-fabric-mcp-server.md) — MCP server · ★ 3799

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
