build-mcpb
ما الذي تفعله
يرشد وكيلك إلى تجميع خادم MCP محلي مع بيئة تشغيله في ملف واحد يسهل على الناس تثبيته. وهو مناسب للمطورين الذين يريدون مشاركة أداة محلية تعمل على حاسوب المستخدم نفسه.
متى تستخدمها
- ✓عندما تريد مشاركة خادم MCP محلي يقرأ الملفات أو يتحكم في تطبيق على سطح المكتب.
- ✓عندما يجب أن يعمل خادم MCP الخاص بك على جهاز المستخدم لا في السحابة.
- ✓عندما تريد أن يثبّت المستخدمون الخادم دون إعداد Node أو Python.
رابط المهارة
https://github.com/anthropics/claude-plugins-official/blob/main/plugins/mcp-server-dev/skills/build-mcpb/SKILL.mdانسخه والصقه في الذكاء الاصطناعي الذي تستخدمه (Claude أو ChatGPT أو Cursor) واطلب منه اتباع التعليمات.
طريقة الاستخدام
أسهل طريقة: انسخ الرسالة والصقها في الذكاء الاصطناعي الذي تستخدمه. سيقرأ المهارة وينفّذ تعليماتها.
رسالة جاهزة للصق
لـ Claude Code أو Codex أو Cursor: شغّله داخل مجلد مشروعك وستُثبَّت المهارة.
نزّل ملف SKILL.md وضعه في مجلد مهارات وكيلك.
مثال على ما تطلبه من الذكاء الاصطناعي
“هل يمكنك تعبئة خادم البحث في الملفات المحلي الخاص بي في ملف واحد يستطيع الناس تثبيته دون Node؟”
5 مهارات جديدة كل أسبوع. قراءة في دقيقة واحدة.
كيف تعمل
يكتب الوكيل ملف manifest يصف الخادم، ويضم شيفرة الخادم وتبعياته، وينتج ملف أرشيف واحدًا. ثم يشغّل المضيف الخادم المحزوم كأنه برنامج محلي.
المحتوى التقني (ملف SKILL.md الأصلي)
النص الأصلي من المؤلف، مباشرة من 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
الأسئلة الشائعة
متى لا أستخدم هذا؟
تقول المهارة إنه إذا كان الخادم يستدعي واجهات سحابية فقط، فغالبًا يكون خادم HTTP بعيد هو الخيار الأفضل.
ماذا يوجد في الحزمة؟
تحتوي على ملف manifest وشيفرة الخادم وتبعياته، وأيقونة.
هل هذه الطريقة الرئيسية لمشاركة خوادم MCP؟
لا. تسميها المهارة المسار الثانوي، وتوصي بالخوادم البعيدة للإدراج في الدليل.
التفاصيل
الوصف الأصلي من المؤلف
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.
الشعبية
- نجوم GitHub
- 46k
- الترتيب
- #6342
- الترخيص
- Apache-2.0
- آخر تحديث
- 2/11/2026
التعليقات
- …
المزيد من المهارات من هذا المستودع
access
46kيتيح لك إدارة من يستطيع مراسلة وكيلك عبر قناة Discord، بما في ذلك موافقات الاقتران وقوائم السماح.
configure
46kيضبط قناة Discord لوكيلك بحفظ رمز البوت، ويتحقق ممن يستطيع الوصول إليه.
access
46kيتيح لك إدارة من يستطيع مراسلة وكيلك عبر قناة iMessage، بما في ذلك الموافقات وقوائم السماح.
configure
46kيتحقق من إعداد قناة iMessage، بما فيه الوصول الكامل إلى القرص، ويشرح من يستطيع الوصول إلى وكيلك.
مهارات مشابهة
mcporter
394kيساعد وكيلك على عرض خوادم MCP وأدواتها واستدعائها وفحصها عبر HTTP أو stdio، وإدارة إعدادات تسجيل الدخول الخاصة بها.
fastmcp
260kيساعدك على بناء خادم MCP بلغة Python واختباره ونشره، ليمنح مساعدي الذكاء الاصطناعي وصولًا إلى واجهة برمجتك أو قاعدة بياناتك أو ملفاتك كأدوات.
mcp-oauth-remote-gateway
260kيرشدك خلال تسجيل الدخول عبر OAuth إلى خادم MCP بعيد، عندما يعمل Hermes على خادم لا يصله تسجيل الدخول العادي عبر المتصفح.