Skip to main content
skill Claude Code official · Anthropic

build-mcpb — Claude Code skill: what it does, how to install

Packages a local MCP server with Node or Python so users can install it without setting up a runtime first.

Install into Claude Code · Plugin marketplace All methods and platforms ↓
/plugin install mcp-server-dev@claude-plugins-official
Open on GitHub

What build-mcpb does

build-mcpb helps you create an MCPB bundle for a local MCP server. The package can include manifest.json, server code, dependencies, and an icon. The host reads the manifest, starts the stdio server, and passes messages to it.

For Node projects, the skill covers bundling with esbuild or shipping dependencies, followed by npx @anthropic-ai/mcpb pack to validate the manifest and create the archive. Python projects can vendor dependencies into server/vendor. The manifest holds the launch command, environment variables, and settings shown during installation.

Use MCPB when the server must access local files, a desktop app, localhost, or OS APIs. The format provides no sandbox or permission block, so path checks and process allowlists belong in your code. A server that only calls a cloud API is usually a better fit for a remote HTTP MCP server.

What it helps with

  • package a local MCP server with its runtime
  • build an .mcpb bundle from a Node server
  • define install-time settings in manifest.json
  • ship an MCP server without requiring Node or Python
  • validate local paths and allowed process launches

Example prompts for the agent

  • Package this local MCP server as an `.mcpb` file and prepare `manifest.json`.
  • Bundle the Node MCP server with `esbuild`, include its dependencies, and run `npx @anthropic-ai/mcpb pack`.
  • Review the security checks needed for a server that reads files under `ROOT_DIR`.

How to install build-mcpb

1Plugin marketplace

/plugin install mcp-server-dev@claude-plugins-official

This installs the whole mcp-server-dev plugin with all its skills

2Skills CLI (Vercel)

npx skills add anthropics/claude-plugins-official --skill build-mcpb -a claude-code

3Manually: put the files in place

~/.claude/skills/build-mcpb/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/build-mcpb/

From the same set37

The whole set →
code-reviewer official Anthropic Reviews code changes against CLAUDE.md project rules and flags material defects. Run it before a commit or pull request. Claude Code 31,050installs code-reviewer official Anthropic This subagent checks code changes for bugs, security issues, and project-rule violations. Use it when a review should focus on findings that matter. Claude Code 31,050installs claude-md-improver official Anthropic This skill audits CLAUDE.md files, produces a quality report, and suggests focused edits. Use it when project instructions need a careful review. Claude Code 12,558installs security-auditor official Anthropic This subagent searches code for security flaws and gives engineers concrete fixes. Use it to review a project before hardening or modernization work. Claude Code 10,718installs test-engineer official Anthropic This subagent captures legacy behavior in tests and compares it with a rewritten implementation. Use it before changing existing modules. Claude Code 9,715installs claude-automation-recommender official Anthropic Analyzes a codebase and recommends Claude Code hooks, subagents, skills, plugins, and MCP servers. Useful when setting up a project or refining an existing workflow. Claude Code 9,057installs playground official Anthropic Builds interactive HTML playgrounds with controls, a live preview, and a generated prompt. Use it when a topic is easier to explore visually than through plain text. Claude Code 7,967installs agent-development official Anthropic This skill guides you through creating agents for Claude Code plugins, from trigger conditions to system prompts and tool access. Use it when adding a subagent to a plugin. Claude Code 7,353installs

Similar

documentation-lookup affaan-m Fetches live library and framework documentation via the Context7 MCP server instead of stale training data. Helps get accurate API methods and configuration examples. Claude Code CX Codex Cursor +1 4,600installs springboot-tdd affaan-m A Spring Boot TDD workflow that starts with failing tests, then implementation and refactoring. Use it for features, bug fixes, and API work. Claude Code CX Codex Cursor +1 4,600installs laravel-verification affaan-m Runs a Laravel project through phases: environment, lint, static analysis, tests with coverage, dependency audit and deploy readiness. Use it before a PR or a release. Claude Code CX Codex Cursor +1 4,600installs stripe-best-practices stripe This skill guides Stripe API choices, payment flows, and integration security. Use it when building, testing, or reviewing Stripe code. Claude Code CX Codex Cursor +1 97,800installs benchmark affaan-m This skill measures page, API, and build performance, then compares results before and after a change. Use it to check a release or investigate reports that a page feels slow. Claude Code CX Codex Cursor +1 4,500installs api-connector-builder affaan-m This skill builds an API connector by following the target repository’s existing integration pattern. Use it when a new provider should fit the current architecture. Claude Code CX Codex Cursor +1 4,500installs mcp-builder official anthropics This skill walks through building an MCP server in TypeScript or Python, from reading the protocol spec to writing tests and evaluation questions. Claude Code Claude.ai 130,949installs google-agents-cli-adk-code official Google A reference skill for building ADK agents with tools, callbacks, state, and workflows. Use it when an agent project needs concrete API patterns or code examples. Claude Code CX Codex Cursor +1 511,400installs

Questions about build-mcpb

How do I install build-mcpb in Claude Code?

Run npx skills add anthropics/claude-plugins-official --skill build-mcpb -a claude-code. The skill file will be placed at ~/.claude/skills/build-mcpb/SKILL.md.

What does build-mcpb do?

It helps package a local MCP server with its runtime, code, and dependencies into an MCPB file. The bundle can run without Node or Python already installed on the user's machine.

Does MCPB provide a built-in sandbox?

No. MCPB runs with the user's privileges, so the server must validate paths, restrict access, and allow only the processes it needs.

Source text

SKILL.md · Apache-2.0
---
name: build-mcpb
description: This skill should be used when the user wants to "package an MCP server", "bundle an MCP", "make an MCPB", "ship a local MCP server", "distribute a local MCP", discusses ".mcpb files", mentions bundling a Node or Python runtime with their MCP server, or needs an MCP server that interacts with the local filesystem, desktop apps, or OS and must be installable without the user having Node/Python set up.
version: 0.1.0
---

# Build an MCPB (Bundled Local MCP Server)

MCPB is a local MCP server **packaged with its runtime**. The user installs one file; it runs without needing Node, Python, or any toolchain on their machine. It's the sanctioned way to distribute local MCP servers.

> MCPB is the **secondary** distribution path. Anthropic recommends remote MCP servers for directory listing — see https://claude.com/docs/connectors/building/what-to-build.

**Use MCPB when the server must run on the user's machine** — reading local files, driving a desktop app, talking to localhost services, OS-level APIs. If your server only hits cloud APIs, you almost certainly want a remote HTTP server instead (see `build-mcp-server`). Don't pay the MCPB packaging tax for something that could be a URL.

---

## What an MCPB bundle contains

```
my-server.mcpb              (zip archive)
├── manifest.json           ← identity, entry point, config schema, compatibility
├── server/                 ← your MCP server code
│   ├── index.js
│   └── node_modules/       ← bundled dependencies (or vendored)
└── icon.png
```

The host reads `manifest.json`, launches `server.mcp_config.command` as a **stdio** MCP server, and pipes messages. From your code's perspective it's identical to a local stdio server — the only difference is packaging.

---

## Manifest

```json
{
  "$schema": "https://raw.githubusercontent.com/anthropics/mcpb/main/schemas/mcpb-manifest-v0.4.schema.json",
  "manifest_version": "0.4",
  "name": "local-files",
  "version": "0.1.0",
  "description": "Read, search, and watch files on the local filesystem.",
  "author": { "name": "Your Name" },
  "server": {
    "type": "node",
    "entry_point": "server/index.js",
    "mcp_config": {
      "command": "node",
      "args": ["${__dirname}/server/index.js"],
      "env": {
        "ROOT_DIR": "${user_config.rootDir}"
      }
    }
  },
  "user_config": {
    "rootDir": {
      "type": "directory",
      "title": "Root directory",
      "description": "Directory to expose. Defaults to ~/Documents.",
      "default": "${HOME}/Documents",
      "required": true
    }
  },
  "compatibility": {
    "claude_desktop": ">=1.0.0",
    "platforms": ["darwin", "win32", "linux"]
  }
}
```

**`server.type`** — `node`, `python`, or `binary`. Informational; the actual launch comes from `mcp_config`.

**`server.mcp_config`** — the literal command/args/env to spawn. Use `${__dirname}` for bundle-relative paths and `${user_config.<key>}` to substitute install-time config. **There's no auto-prefix** — the env var names your server reads are exactly what you put in `env`.

**`user_config`** — install-time settings surfaced in the host's UI. `type: "directory"` renders a native folder picker. `sensitive: true` stores in OS keychain. See `references/manifest-schema.md` for all fields.

---

## Server code: same as local stdio

The server itself is a standard stdio MCP server. Nothing MCPB-specific in the tool logic.

```typescript
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
import { z } from "zod";
import { readFile, readdir } from "node:fs/promises";
import { join } from "node:path";
import { homedir } from "node:os";

// ROOT_DIR comes from what you put in manifest's server.mcp_config.env — no auto-prefix
const ROOT = (process.env.ROOT_DIR ?? join(homedir(), "Documents"));

const server = new McpServer({ name: "local-files", version: "0.1.0" });

server.registerTool(
  "list_files",
  {
    description: "List files in a directory under the configured root.",
    inputSchema: { path: z.string().default(".") },
    annotations: { readOnlyHint: true },
  },
  async ({ path }) => {
    const entries = await readdir(join(ROOT, path), { withFileTypes: true });
    const list = entries.map(e => ({ name: e.name, dir: e.isDirectory() }));
    return { content: [{ type: "text", text: JSON.stringify(list, null, 2) }] };
  },
);

server.registerTool(
  "read_file",
  {
    description: "Read a file's contents. Path is relative to the configured root.",
    inputSchema: { path: z.string() },
    annotations: { readOnlyHint: true },
  },
  async ({ path }) => {
    const text = await readFile(join(ROOT, path), "utf8");
    return { content: [{ type: "text", text }] };
  },
);

const transport = new StdioServerTransport();
await server.connect(transport);
```

**Sandboxing is entirely your job.** There is no manifest-level sandbox — the process runs with full user privileges. Validate paths, refuse to escape `ROOT`, allowlist spawns. See `references/local-security.md`.

Before hardcoding `ROOT` from a config env var, check if the host supports `roots/list` — the spec-native way to get user-approved directories. See `references/local-security.md` for the pattern.

---

## Build pipeline

### Node

```bash
npm install
npx esbuild src/index.ts --bundle --platform=node --outfile=server/index.js
# or: copy node_modules wholesale if native deps resist bundling
npx @anthropic-ai/mcpb pack
```

`mcpb pack` zips the directory and validates `manifest.json` against the schema.

### Python

```bash
pip install -t server/vendor -r requirements.txt
npx @anthropic-ai/mcpb pack
```

Vendor dependencies into a subdirectory and prepend it to `sys.path` in your entry script. Native extensions (numpy, etc.) must be built for each target platform — avoid native deps if you can.

---

## MCPB has no sandbox — security is on you

Unlike mobile app stores, MCPB does NOT enforce permissions. The manifest has no `permissions` block — the server runs with full user privileges. `references/local-security.md` is mandatory reading, not optional. Every path must be validated, every spawn must be allowlisted, because nothing stops you at the platform level.

If you came here expecting filesystem/network scoping from the manifest: it doesn't exist. Build it yourself in tool handlers.

If your server's only job is hitting a cloud API, stop — that's a remote server wearing an MCPB costume. The user gains nothing from running it locally, and you're taking on local-security burden for no reason.

---

## MCPB + UI widgets

MCPB servers can serve UI resources exactly like remote MCP apps — the widget mechanism is transport-agnostic. A local file picker that browses the actual disk, a dialog that controls a native app, etc.

Widget authoring is covered in the **`build-mcp-app`** skill; it works the same here. The only difference is where the server runs.

---

## Testing

```bash
# Interactive manifest creation (first time)
npx @anthropic-ai/mcpb init

# Run the server directly over stdio, poke it with the inspector
npx @modelcontextprotocol/inspector node server/index.js

# Validate manifest against schema, then pack
npx @anthropic-ai/mcpb validate
npx @anthropic-ai/mcpb pack

# Sign for distribution
npx @anthropic-ai/mcpb sign dist/local-files.mcpb

# Install: drag the .mcpb file onto Claude Desktop
```

Test on a machine **without** your dev toolchain before shipping. "Works on my machine" failures in MCPB almost always trace to a dependency that wasn't actually bundled.

---

## Reference files

- `references/manifest-schema.md` — full `manifest.json` field reference
- `references/local-security.md` — path traversal, sandboxing, least privilege

© Anthropic · Apache-2.0 · anthropics/claude-plugins-official

See also

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor