
Backblaze B2 MCP Server
io.github.backblaze-labs由 GitHub 账号 backblaze-labs 发布v0.2.2更新于 Oct 24, 2026
Official Backblaze B2 MCP server for buckets, files, keys, Object Lock, and S3 storage.
概览
Backblaze 官方 B2 MCP 服务器,让 AI 助手管理 B2 存储桶、对象、应用密钥、Object Lock 和 S3 兼容存储。
- 可以做什么
- 通过原生 B2 工具验证账户、列出、创建、更新和删除存储桶,并读取存储桶设置与通知规则。列出、创建和撤销应用密钥,并为对象设置法定保留或保留期。通过 S3 兼容工具上传、下载、复制、列出和删除对象,包括分片上传、预签名 URL、存储桶位置和生命周期规则。运行存储分析:用量增长、出口流量排名、最大文件和未完成的分片上传。以只读资源读取服务器配置、能力集和存储桶状态。
- 适用场景
- 适合在桌面 MCP 客户端中让助手直接操作 Backblaze B2 存储:浏览和整理存储桶与文件、签发受限密钥、应用 Object Lock 或保留策略,或查看存储与出口用量。
- 运行要求
- 通过 npx 以 stdio 在本地运行,需要受支持的 Node.js 运行时(22.22.2 及以上、24 或 26),并通过 B2_APPLICATION_KEY_ID 和 B2_APPLICATION_KEY 提供 Backblaze B2 应用密钥。Partner/Groups 工具还需 B2_MASTER_KEY_ID 和 B2_MASTER_KEY。B2_REGION 为可选的回退区域。
安装
在 SourceWeft 中
- 打开 控制台中的 Backblaze B2 MCP Server,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
Backblaze B2 MCP Server
[CI] [CodeQL] [npm] [License: MIT] [TypeScript] [Node.js] [MCP] [API docs] [Coverage floors] [Runtime dependencies]
[MCP Registry] [Glama] [Verified by M8ven] [MCP Badge] [Listed on awesome-remote-mcp-servers]
A Model Context Protocol server for Backblaze B2 Cloud Storage. It lets any MCP-compatible AI client (Claude, and others) operate B2 through a focused, safe set of tools, currently incubating in Backblaze-Labs.
This is the official Backblaze B2 MCP server —
backblaze-labs/b2-mcp, published as@backblaze-labs/b2-mcpon npm and listed in the Official MCP Registry asio.github.backblaze-labs/b2-mcp. Community forks and third-party wrappers are not maintained by Backblaze.
40 tools, assigned by backing category:
- Native B2 SDK (
@backblaze-labs/b2-sdk) (17) — B2 control-plane operations the S3 API has no equivalent for: buckets, application keys, Object Lock, event notifications, and Partner/Groups operations. - AWS S3 SDK (
@aws-sdk/client-s3) (19) — the S3-compatible data plane: object upload/download/copy/list/delete, multipart, bucket reachability, lifecycle, and presigned URL paths. - Neither SDK (custom MCP code) (4) — repository-owned analytics over B2 reports and bounded live listings: storage growth, egress leaders, largest files, and abandoned uploads.
Destructive actions are gated, durable B2 secrets stay out of the model's context in the default/file/off modes, and registration is capability-aware so a key only ever sees tools it can use. The server also exposes read-only MCP resources: b2://server-config (non-secret, registered even during credential-less discovery), plus capability-gated b2://capabilities and b2://bucket/{bucketName}.
Contents
- Quick start
- B2 Skills pack
- Configuration
- Tools
- Package API Surface
- CLI Reference
- Resources
- Security & self-hosting
- Privacy
- Development
- Documentation
- Backblaze Labs ecosystem
Quick start
Prerequisites: A supported Node.js runtime and a Backblaze B2 application key. A non-master key is all you need. The package engine range is ^22.22.2 || ^24 || ^26; CI runs on Node.js 22.23.1, 24, and 26. One non-master application key covers normal storage work (B2 native, S3, and key management); the Partner/Groups tools additionally need B2_MASTER_KEY_ID / B2_MASTER_KEY.
Option A — npx (Claude Desktop config)
Edit claude_desktop_config.json (macOS: ~/Library/Application Support/Claude/, Windows: %APPDATA%\Claude\, Linux: ~/.config/Claude/) and add:
Restart Claude Desktop and the B2 tools appear. If you need an explicit fallback region before authorization, add B2_REGION to the same env block (S3/report tools otherwise derive their region from the authorized B2 account response):
The canonical package name is @backblaze-labs/b2-mcp and the canonical binary is b2-mcp (b2-mcp-server is a transition alias); npx -y @backblaze-labs/b2-mcp runs it directly. See Configuration for the full variable list, and docs/product-specs/clients.md for a source-checkout setup and copy-paste configs for Cursor, VS Code, Cline, Windsurf, Zed, Continue, Goose, Claude.ai, and hosted (Streamable HTTP).
Option B — Claude Desktop extension (MCPB)
Available once a release publishes the
b2-mcp.mcpbasset (0.2.1 onward); earlier releases carry no bundle, so use Option A until the asset appears on the releases page.
Prefer no JSON editing? 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 prompts for your Application Key ID and Application Key (Region and Master keys optional) — no config file to hand-edit. The bundle launches a version-pinned npx -y @backblaze-labs/b2-mcp@<version> (npm resolves the server on first run) so it always runs the exact published version. A one-click Claude Connectors Directory listing is in progress.
Then just ask:
"List the buckets this key can access." · "Upload
./data.csvtoreports/may-2026.csv." · "Give me a 1-hour download link forbackups/latest.tar.gz." · "List files underlogs/2026/."
Why your client may show fewer than 40 tools: registration is capability-aware. With a non-master key and no master key configured, the three Partner/Groups tools that require a master key are not surfaced, so
tools/listreports 37; addB2_MASTER_KEY_ID/B2_MASTER_KEYon a Partner-entitled account for the full 40. A read-only key trims the surface further. Credential-free scanners see the full advertised surface, but everytools/callreturnsmissing_credentialsuntil valid B2 credentials are supplied.
Docker
The published image defaults to the HTTP transport and reads configuration only from environment variables (no mutable latest tag — pin the release version):
For stdio clients inside a container, pass the transport explicitly and keep stdin open:
Deploying to hosted HTTP? See the deployment matrix and provider guides (Docker, Vercel, Cloudflare, AWS, GCP, Azure, Render, Railway, Fly.io) linked from Security & self-hosting, and docs/references/deployment/docker.md for hardened HTTP examples.
B2 Skills pack
This repo bundles a client-side Backblaze B2 skills pack under skills/ (manifest: skills/pack.json) — Markdown playbooks for common workflows (backup/restore, least-privilege keys, Object Lock, lifecycle and cost hygiene, migration, incident response). The MCP server is the action layer; these are the expertise layer. They add no endpoints or permissions — they only sequence existing tools and reinforce the same byte-path and destructive-action guardrails the server enforces.
Optional but recommended for clients that support Markdown skills. Load them by placing each skills/b2-*/ directory under ~/.claude/skills/ (Claude Code), or upload per-skill ZIPs via Settings → Capabilities → Skills (Claude.ai / Claude Desktop). Validate the pack locally:
Configuration
Security / policy (safe defaults; override as needed):
A ready-to-copy .env.example lists the local variables, and deploy/customer-hosted/b2-mcp.env.example lists the hosted container baseline. HTTP-only file-access vars (B2_ALLOW_LOCAL_FILES, B2_FILE_ROOT) are covered in docs/DEPLOY.md; the capability/cache tuning knobs above are documented inline here.
Tools
The server exposes 40 tools (registration is capability-aware, so a given key sees only the subset it can use). 40 total — 17 Native B2 SDK + 19 AWS S3 SDK + 4 Neither SDK/custom MCP tools. Prefix counts remain 21 native b2_* names + 19 data-plane s3_* names. Under stdio's default confirm policy, fifteen destructive, durable-secret-producing, or protection-weakening tools require confirmation before execution; HTTP defaults to block. The per-profile, availability-annotated tool lists (per capability set) live in the generated docs/generated/tool-profiles.md; the destructive-gate policy and durable-secret handling (secret sinks, idempotency keys, POSIX vs. Windows behavior) are documented in docs/AUTHENTICATION.md.
Native B2 SDK (17):
b2_authorize_account— Verify credentials and return account infob2_list_buckets— List buckets (optional filters)b2_create_bucket— Create a persistent bucket with initial policy settingsb2_delete_bucket— Delete an empty bucketb2_update_bucket— Update persistent bucket settings; risky changes are gatedb2_get_bucket_notification_rules— Read webhook notification rules with secrets redactedb2_set_bucket_notification_rules— Replace webhook notification rules; public HTTPS targets onlyb2_list_keys— List application keysb2_delete_key— Irreversibly revoke an application keyb2_create_key— Create a scoped application key through the configured secret sinkb2_update_file_legal_hold— Set/clear legal hold on an objectb2_update_file_retention— Set/clear retention on an objectb2_list_groups— List partner groups (Partner API credential)b2_eject_group_member— Remove a member from a partner group (Partner API credential)b2_list_group_members— List group members (Partner API credential)b2_create_group_member— Create a Partner group member (Partner API credential)b2_reserve_trial_create_account— Reserve a trial account (Partner API credential)
AWS S3 SDK — data plane (19):
s3_put_object— Inline upload of a small (≤1 MiB) control-plane objects3_get_object— Inline download of a small (≤1 MiB) control-plane objects3_delete_object— Delete current object or exact version; destructive gate appliess3_delete_objects— Bulk-delete objectss3_head_object— Object metadatas3_copy_object— Server-side copys3_list_objects_v2— List objectss3_list_object_versions— List object versions and delete markers (paginated)s3_create_multipart_upload— Begin a multipart uploads3_get_presigned_upload_part_url— Mint a presigned PUT URL for a parts3_complete_multipart_upload— Complete multipart upload from ordered part ETagss3_abort_multipart_upload— Abort a multipart uploads3_list_parts— List uploaded partss3_list_multipart_uploads— List in-progress multipart uploads (paginated)s3_upload_part_copy— Server-side copy of a parts3_get_presigned_url— Short-lived presigned PUT/GET bearer URLs3_head_bucket— Check a bucket is reachable on the S3 endpoints3_get_bucket_location— Bucket region / location constraints3_put_bucket_lifecycle— Set S3 lifecycle rules
Custom MCP analytics (4):
b2_report_usage_growth— Rank accounts by stored-data growth between two datesb2_rank_egress_leaders— Top egress by account or bucket over a periodb2_list_largest_files— A bucket's largest objects via bounded live listingb2_unfinished_uploads— Abandoned multipart uploads consuming storage
MCP workflow prompts (opt-in): off by default; set B2_ENABLE_MCP_PROMPTS=true to advertise five guided workflows through prompts/list / prompts/get. Prompts are parameterized message templates — they do not execute tools or approve destructive actions — and are filtered against the same tool surface and capability map as tools. Flip the flag atomically across the fleet (it gates registration and advertisement together).
Package API Surface
The npm package intentionally supports only the root CommonJS entry
(require("@backblaze-labs/b2-mcp")), which exposes
startStdio(): Promise<void>, plus ./package.json for metadata. TypeScript
consumers may compile against that same root CommonJS surface:
Programmatic TypeScript imports beyond that root entry are not a supported
public API. ESM named imports are not part of the contract. Deep imports such as
@backblaze-labs/b2-mcp/dist/server.js are private implementation details closed
by the package exports map. Use the CLI/bin entry or the root startStdio
export instead.
CLI Reference
The source entry point and installed package binary share the same CLI:
Tool results carry the lossless value in structuredContent; the LLM-facing
text block is selected by B2_MCP_OUTPUT_FORMAT (json default, or opt-in
toon). See docs/design-docs/tool-contract.md#structured-result-text-contract
for the output-format contract.
Resources
Read-only MCP resources expose stable control-plane state without a tool call:
b2://server-config— non-secret server configuration (transport, credential mode, destructive policy, secret-sink mode, public URL, version).b2://capabilities— the current credential's B2 capability set and active tool profile.b2://bucket/{bucketName}— bucket type/visibility, lifecycle, Object Lock, retention, encryption, CORS, replication, and notification rules when the caller can read them (webhook secrets redacted).
resources/list is capped at 100 concrete bucket resources; use the template URI directly for a known authorized bucket. Bucket reads omit a client cache hint because visibility and notification targets are security-relevant after writes.
Security & self-hosting
Built-in safeguards (on by default): destructive-action gating (B2_DESTRUCTIVE_POLICY), MCP form elicitation for destructive tools on 2026-capable clients, sink-backed durable-secret creation for local stdio with hosted HTTP fail-closed defaults, central recursive response sanitization, explicit credential-provider modes, capability-aware registration that fails closed, rate limiting, and a values-redacted audit log (non-secret credential fingerprints only). The server never phones home.
- Local use → stdio. Credentials stay in your client config / environment; the default
confirmpolicy asks before destructive actions. - Internet-facing HTTP →
B2_DESTRUCTIVE_POLICY=blockis the required wall (the HTTP default). Elicitation is relayed by the client, so it is human-in-the-loop friction, not an independent authorization boundary. - Choose a credential mode.
headers(default, compatibility),server(one B2 credential held in the process / a secret manager), orprincipal(map verified MCPauthInfoto customer-held credentials). Credential-free discovery (initialize,tools/list,resources/list,prompts/list,server/discover,ping) runs without keys so scanners can enumerate; realtools/callstill requires credentials. - Use a least-privilege key. A non-master key is correct for normal storage.
b2_create_keyrefuses key-management grants, unscoped write/delete grants, and over-long or non-expiring keys unless the matching override is set. - Presigned URLs are not durable secrets.
s3_get_presigned_url/s3_get_presigned_upload_part_urlreturn short-lived bearer capabilities (expiresIn/expiresAt) — sensitive until expiry, but not long-lived B2 keys. - Never commit credentials — use env vars / a secrets manager.
.env*is gitignored.
Supported deployments: deploy/customer-hosted (portable container, compose, nginx/OAuth edge) and deploy/vercel (OAuth-secured adapter). Provider guides: Docker/OCI, Vercel, Cloudflare Workers, Cloudflare Containers, Google Cloud Run, AWS ECS Fargate, Azure Container Apps, Render, Railway, and Fly.io — all sharing the security & credential contract.
Full hosted runbook (nginx, Let's Encrypt, hardened systemd, fail2ban, monitoring, and a security baseline checklist): deploy/customer-hosted/README.md (indexed from the docs/DEPLOY.md matrix). Authentication, credential custody, and OAuth details are in docs/AUTHENTICATION.md.
Privacy
b2-mcp runs locally over stdio or in a self-hosted HTTP deployment controlled by the user or operator. The publisher does not receive runtime B2 credentials, object data, prompts, logs, or telemetry from normal use. Object-byte workflows should use presigned URLs so bytes move directly between the client or worker and Backblaze B2, and logs are structured with secret redaction.
Read the canonical PRIVACY.md source or the hosted privacy policy published by GitHub Pages.
Development
From a fresh source checkout, enable the pinned package manager and install dependencies first, then run any of the scripts below:
The full script list (diagnostics, slow tests, provider-comparison evals, inspector smoke) is in docs/TESTING.md. Compatible MCP Inspector: @modelcontextprotocol/[email protected] (Node.js 22.19.0+), run via pnpm run smoke:inspector.
Documentation
- API reference — generated TypeDoc for the public
srcsurface - Privacy policy /
PRIVACY.md— runtime data-handling policy docs/product-specs/clients.md— per-client setup + compatibility matrixdocs/AUTHENTICATION.md— OAuth, credential custody, and auth boundarydocs/DEPLOY.md— deployment matrix and supported-host linksdocs/references/deployment/security-and-credentials.md— shared hosted security contractdocs/generated/tool-profiles.md— generated per-tool availability referencedocs/design-docs/index.md— public contract register with owners and statusdocs/design-docs/tool-contract.md— tool-contract and naming-convention policydocs/TESTING.md/docs/EVALS.md— test gate and LLM eval runbooksdocs/references/discoverability.md— registry/directory listings runbookRELEASE.md·CHANGELOG.md·SECURITY.md
Backblaze Labs ecosystem
Part of Backblaze Labs:
- Genblaze — Python SDK for orchestrating generative-AI media pipelines across video, audio, and image providers, with built-in provenance for every output.
- b2-sdk-typescript —
Backblaze-maintained TypeScript / JavaScript SDK for B2 Cloud Storage
(published as
@backblaze-labs/b2-sdk, the SDK this server is built on). - b2-action — Backblaze-maintained GitHub Action for B2 Cloud Storage.
License
MIT — © 2026 Backblaze, Inc.
来源:README.md,提交 a92f18a
工具
0版本历史
2- v0.2.2最新Sep 30, 2026
- v0.2.1Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分