| name | build-mcpb |
| description | This skill should be used when the user wants to package an MCP server, bundle a local MCP server, make an MCPB, ship a local server without a separate runtime install, or distribute a local filesystem, desktop, hardware, or localhost integration. |
| version | 0.2.0 |
Build an MCPB
Provenance: Forked from anthropics/claude-plugins-official/plugins/mcp-server-dev under Apache-2.0. Significant changes: updated for the current MCPB 0.4 schema and modern-vs-legacy protocol handling. See ../THIRD-PARTY-NOTICES.md.
MCPB packages a local MCP server and its runtime as one installable archive. Choose it only when code must execute on the user's machine: local files, hardware, desktop automation, or localhost services. A cloud-API wrapper should normally be a remote HTTP server.
MCPB does not change MCP semantics
MCPB is distribution, not a protocol mode. Its server speaks stdio. The removal of initialize affects modern stdio as well as HTTP; do not write a new server or test fixture that assumes an initialization exchange.
A TypeScript v2 stdio server uses the v2 factory/server API and serveStdio. It may deliberately serve legacy clients too, but that is a dual-era decision—not a reason to hardcode initialize. See build-mcp-server/references/dual-era.md.
HTTP session removal does not alter the process-level fact that a stdio server is long-lived. Still avoid hiding durable application state in a connection object; use explicit state handles and authorization checks.
Manifest 0.4
The current MCPB source schema declares manifest_version: "0.4". Version 0.4 adds the uv Python runtime type.
{
"$schema": "https://raw.githubusercontent.com/modelcontextprotocol/mcpb/main/schemas/mcpb-manifest-v0.4.schema.json",
"manifest_version": "0.4",
"name": "local-files",
"version": "0.1.0",
"description": "Read and search files under a selected local directory.",
"author": { "name": "Your Name" },
"server": {
"type": "node",
"entry_point": "server/index.js",
"mcp_config": {
"command": "node",
"args": ["${__dirname}/server/index.js"],
"env": {
server.type is one of node, python, binary, or uv. mcp_config is the literal process command, arguments, and environment. There is no automatic environment-variable prefix and no manifest permission sandbox.
Build a defensible local server
- Register narrow, single-purpose tools; separate reads from writes.
- Resolve every input path and enforce containment below an approved root.
- Construct child-process arguments as arrays; never concatenate shell input.
- Keep user configuration, tokens, and runtime diagnostics out of model-visible output.
- Make destructive behavior visible with tool annotations and explicit confirmation.
roots/list is a deprecated legacy feature, not a prerequisite for local-file safety. Use an install-time directory selection or an explicit, validated path capability instead.
Package and smoke-test
npx --yes @anthropic-ai/mcpb@2.1.2 validate manifest.json
npx --yes @anthropic-ai/mcpb@2.1.2 pack . inventory.mcpb
Run the packed server on a machine without the development toolchain. Exercise its stdio path with the intended host or Inspector, then install the resulting .mcpb in the target desktop host.
C# alternative
For C# servers, Microsoft also supports tool-style local distribution through PackAsTool and dnx. This can be a better fit for .NET-centric organizations that control the .NET runtime, while MCPB remains the all-in-one bundle path. Route to build-mcp-server-dotnet for its packaging decision tree.
References
references/manifest-schema.md — full manifest fields and 0.4 schema details
references/local-security.md — containment, process safety, and least privilege
references/versions.md — version ledger and verification commands