Langsung ke konten
Skillpedia
Konektor (MCP)46k Β· #6342

build-mcpb

Fungsinya

Skill ini memandu agent Anda untuk membungkus server MCP lokal beserta runtime-nya ke dalam satu file yang mudah dipasang orang. Skill ini ditujukan untuk developer yang ingin membagikan alat lokal yang berjalan di komputer pengguna sendiri.

Kapan dipakai

  • βœ“Saat Anda ingin membagikan server MCP lokal yang membaca file atau mengendalikan aplikasi desktop.
  • βœ“Saat server MCP Anda perlu berjalan di mesin pengguna, bukan di cloud.
  • βœ“Saat Anda ingin pengguna memasang server tanpa harus menyiapkan Node atau Python.

Link skill

https://github.com/anthropics/claude-plugins-official/blob/main/plugins/mcp-server-dev/skills/build-mcpb/SKILL.md

Salin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.

Cara pakai

Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.

Pesan siap tempel

Gunakan skill ini untuk membantu saya: https://github.com/anthropics/claude-plugins-official/blob/main/plugins/mcp-server-dev/skills/build-mcpb/SKILL.md Baca file SKILL.md di link tersebut dan ikuti instruksinya untuk tugas saya.
Mau AI Anda menemukan skill seperti ini sendiri?Pasang MCP Skillpedia gratis: cukup satu baris, dan AI mencari di antara 15.000+ skill sebelum tiap tugas.Pasang dalam 1 menit β†’

Contoh permintaan ke AI

β€œBisakah Anda mengemas server MCP pencarian file lokal saya menjadi satu file yang bisa dipasang orang tanpa Node?”

5 skill baru setiap minggu. 1 menit baca.

Cara kerjanya

Agent menulis manifes yang mendeskripsikan server, menggabungkan kode server beserta dependensinya, lalu menghasilkan satu file arsip. Host kemudian menjalankan server yang sudah dikemas itu seperti program lokal.

Konten teknis (SKILL.md asli)

Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.

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

{
  "$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.

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

Pertanyaan umum

Kapan sebaiknya saya tidak memakai ini?

Skill ini menyebutkan jika server hanya memanggil API cloud, server HTTP remote biasanya pilihan yang lebih baik.

Apa saja yang ada di dalam bundel?

Berisi manifes, kode server beserta dependensinya, dan ikon.

Apakah ini cara utama untuk membagikan server MCP?

Bukan. Skill ini menyebutnya jalur sekunder, dan merekomendasikan server remote untuk dicantumkan di direktori.

Detail

Deskripsi asli dari pembuat

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.

repo: anthropics/claude-plugins-official

Popularitas

Bintang GitHub
46k
Peringkat
#6342
Lisensi
Apache-2.0
Diperbarui
2/11/2026

Apakah skill ini berguna?

0

Masuk untuk memberi suara.

Komentar

  • …

Skill lain dari repositori ini

Skill serupa