Purpose
b2-mcp is Backblaze's official Model Context Protocol (MCP) server for B2 cloud storage. It lets any MCP-compatible AI client (such as Claude, as well as Cursor, VS Code, Cline, Windsurf, Zed, Continue, Goose, Claude.ai, etc.) operate B2 through a focused and secure set of tools. The project is currently being incubated in Backblaze-Labs.
This repository is the official Backblaze B2 MCP server, published as the npm package @backblaze-labs/b2-mcp, and registered in the official MCP Registry (io.github.backblaze-labs/b2-mcp). Community forks and third-party wrappers are not maintained by Backblaze.
Main Capabilities
The server provides a total of 40 tools, categorized by underlying implementation:
Native B2 SDK (@backblaze-labs/b2-sdk, 17): Covers B2 control-plane operations that have no corresponding capability in the S3 API, including buckets, application keys, Object Lock, event notifications, and Partner/Groups operations.
AWS S3 SDK (@aws-sdk/client-s3, 19): The S3-compatible data plane, including object upload/download/copy/list/delete, multipart upload, bucket reachability checks, lifecycle, and presigned URL paths.
Neither (custom MCP code, 4): Analytics based on B2 reports and restricted real-time listings, including storage growth, egress traffic rankings, largest files, and unfinished uploads.
Tool results are stored losslessly in structuredContent; the text block for the LLM is selected by B2_MCP_OUTPUT_FORMAT (default json, optional toon).
Destructive operations are blocked by default: under the stdio default confirm policy, 15 tools that are destructive, generate persistent keys, or weaken protections require confirmation before execution; HTTP defaults to block. Persistent B2 keys do not enter the model context in default/file/off modes. Tool registration is capability-aware, and a key can only see its availabletools.
The server also exposes read-only MCP resources: b2://server-config (non-secret, also registered during the credential-free discovery phase), b2://capabilities (exposed by capability), and b2://bucket/{bucketName}. resources/list lists up to 100 concrete bucket resources.
The repository includes a client-side Backblaze B2 skills pack under skills/ (manifest: skills/pack.json), containing Markdown playbooks for common workflows (backup/restore, least-privilege keys, Object Lock, lifecycle and cost governance, migration, incident response). The MCP server is the action layer, and the skills pack is the expertise layer; it adds no endpoints or permissions.
Usage
Prerequisites: A supported Node.js runtime and a Backblaze B2 application key. A non-master key is sufficient for ordinary storage work. The package's engine range is ^22.22.2 || ^24 || ^26; CI runs on Node.js 22.23.1, 24, and 26. A single non-master application key covers regular storage work (B2 native, S3, and key management); Partner/Groups tools additionally require B2_MASTER_KEY_ID / B2_MASTER_KEY.
Option A — npx (Claude Desktop configuration): Edit claude_desktop_config.json (macOS: ~/Library/Application Support/Claude/, Windows: %APPDATA%\Claude, Linux: ~/.config/Claude/) and add the configuration; restart Claude Desktop and the B2 tools will appear. If you need to explicitly specify a fallback region before authorization, you can add B2_REGION in the same env block. The canonical package name is @backblaze-labs/b2-mcp, and the canonical binary is b2-mcp (b2-mcp-server is a transitional alias); npx -y @backblaze-labs/b2-mcp can be run directly.
Option B — Claude Desktop extension (MCPB): Available once a release publishes the b2-mcp.mcpb asset (from 0.2.1 onward); earlier versions do not include the packaged file, so use method A. No need to edit JSON: download b2-mcp.mcpb from the latest release, then in Claude Desktop open Settings → Extensions → Advanced settings → Extension Developer → Install Extension…, and select the downloaded file. Claude Desktop will prompt for the Application Key ID and Application Key (Region and Master key are optional), with no need to manually edit a configuration file.
Container/hosted: Published images use HTTP transport by default and read configuration only from environment variables (there is no mutable latest tag; a fixed release version is required). The stdio client inside the container must explicitly pass the transport method and keep stdin open. For hosted HTTP deployments, see the deployment matrix and provider guides (Docker, Vercel, Cloudflare, AWS, GCP, Azure, Render, Railway, Fly.io).
Example usage: "List the buckets this key can access." "Upload ./data.csv to reports/may-2026.csv." "Give me a 1-hour download link for backups/latest.tar.gz." "List the files under logs/2026/."
Why the client may show fewer than 40 tools: Registration is capability-aware. When using a non-master key and no master key is configured, the three Partner/Groups tools that require a master key will not appear, and tools/list reports 37; on an account with Partner permissions, adding B2_MASTER_KEY_ID / B2_MASTER_KEY gives the full 40. A read-only key further reduces the tool surface. A credential-less scanner can see the full published surface, but every tools/call will return missing_credentials until valid B2 credentials are provided.
When to use
- Through an AI clientManage B2 buckets and files at the edge (list, upload, download, copy, delete).
- Generate short-lived presigned URLs for file sharing or uploading.
- Manage application keys, creating keys with limited scope.
- Configure Object Lock legal hold and retention policies.
- Read and set bucket notification rules and lifecycle rules.
- Use analytics tools to view storage growth, egress traffic rankings, largest files, and incomplete uploads.
- Local use (stdio) or internet-facing HTTP hosted deployment.
Limits and Security
Built-in protections enabled by default include: destructive operation interception (B2_DESTRUCTIVE_POLICY), MCP form confirmation for destructive tools on 2026-capable clients, sink support for local stdio with persistent key creation and fail-closed defaults for hosted HTTP, centralized recursive response sanitization, explicit credential provider modes, capability-aware fail-closed registration, rate limiting, and value-redacted audit logging (non-secret credential fingerprints only). The server does not call back out to external services.
Credential modes are headers (default, compatibility), server (holds one B2 credential in-process or in a key manager), and principal (maps verified MCP authInfo to a customer-held credential). Credential-free discovery (initialize, tools/list, resources/list, prompts/list, server/discover, ping) runs without keys so scanners can enumerate; actual tools/call still requires credentials.
Least-privilege keys are recommended; non-master keys suffice for ordinary storage use. b2_create_key rejects key management authorization, unscoped write/delete authorization, and overly long or never-expiring keys unless the corresponding override is set. Presigned URLs are not persistent keys; they are short-lived bearer capabilities (expiresIn / expiresAt). Never commit credentials; use environment variables or a key manager; .env* is already in gitignore.
MCP workflow prompts are disabled by default; set B2_ENABLE_MCP_PROMPTS=true to publish the five guided workflows via prompts/list / prompts/get. Prompts are just parameterized message templates and do not execute tools or approve destructive operations.execute tools or approve destructive operations.
The npm package only supports a root CommonJS entry (require("@backblaze-labs/b2-mcp")), exposing startStdio(): Promise<void>, plus ./package.json for metadata. Deeper programmatic TypeScript imports are not part of the supported public API; ESM named imports are not within the contract; deep imports such as @backblaze-labs/b2-mcp/dist/server.js are private implementation details.
For supported deployments, the full hosted runbook, authentication and credential hosting, and OAuth details, see docs/DEPLOY.md and docs/AUTHENTICATION.md in the repository.