mcp-builder
为 Claude Code 构建 MCP 服务器
متاح أيضًا من: AutumnsGrove,92Bilal26,YYH211,anthropics,92Bilal26,davila7,ZhanlinCui,ArtemisAI,Azeem-2,Doyajin174,DYAI2025,Cam10001110101,ComposioHQ,mcp-use
本技能提供全面的指导,帮助构建模型上下文协议(MCP)服务器,使 Claude Code 和 Codex 能够通过精心设计的工具与外部 API 进行交互。内容涵盖 TypeScript 和 Python 实现、最佳实践以及评估策略。
تنزيل ZIP المهارة
رفع في Claude
اذهب إلى Settings → Capabilities → Skills → Upload skill
فعّل وابدأ الاستخدام
اختبرها
استخدام "mcp-builder". How do I set up a basic MCP server project in TypeScript?
النتيجة المتوقعة:
要设置一个基础的 TypeScript MCP 服务器项目:
1. 初始化新的 Node.js 项目:npm init -y
2. 安装 MCP TypeScript SDK:npm install @modelcontextprotocol/server-sdk
3. 使用 Zod 创建包含工具定义的服务器文件以进行输入验证
4. 向服务器注册工具并定义传输方式(stdio 或 Streamable HTTP)
5. 导出服务器以便与所选传输方式一起使用
本技能为每个步骤提供了完整的示例和代码片段。
استخدام "mcp-builder". What are the best practices for tool naming in MCP servers?
النتيجة المتوقعة:
MCP 工具命名的最佳实践:
- 使用一致的前缀(例如 github_create_issue、github_list_repos)
- 使用面向动作的名称来描述工具的功能
- 使名称能够描述所集成的服务
- 避免在名称中使用版本号
- 使用清晰、无歧义的名称,帮助智能体快速找到正确的工具
استخدام "mcp-builder". How should I structure error messages in my MCP server?
النتيجة المتوقعة:
错误消息应具有可操作性并引导智能体找到解决方案:
- 包含修复错误的具体建议
- 提供智能体可以采取的下一步操作
- 使用标准的 JSON-RPC 错误代码
- 使错误消息描述足够详细,让 LLM 能够理解出了问题以及如何恢复
التدقيق الأمني
آمنThis skill is a documentation and guide resource for building MCP servers. The static scanner detected patterns (network calls, environment variable access, shell commands) in reference documentation files containing code examples. These are all false positives - the skill contains no executable code, only markdown documentation with example code snippets demonstrating standard API integration patterns.
عوامل الخطر
⚡ يحتوي على سكربتات
🌐 الوصول إلى الشبكة
📁 الوصول إلى نظام الملفات
🔑 متغيرات البيئة
⚙️ الأوامر الخارجية
درجة الجودة
ماذا يمكنك بناءه
为自定义 API 构建新的 MCP 服务器
开发者希望创建一个 MCP 服务器,将公司的内部 API 与 Claude Code 集成。他们按照逐步指南来规划、实现和测试他们的 MCP 服务器。
学习 MCP 协议最佳实践
技术撰稿人或产品经理希望了解 MCP 服务器的工作原理以及什么使它们对 LLM 集成有效。
评估现有 MCP 服务器质量
AI 工程师希望评估他们的 MCP 服务器实现,确保 LLM 能够有效使用所提供的工具。
جرّب هذه الموجهات
Help me create a basic MCP server using the TypeScript SDK. I want to expose a simple API (like a todo list) with create, read, update, and delete tools. Show me the project structure and core implementation.
How do I add API key authentication to my MCP server? I need to read the API key from an environment variable and include it in requests to the external service.
Review my MCP server tool descriptions and suggest improvements. I want to make sure Claude Code can understand what each tool does and use them effectively. Here are my current tool definitions: [add tool definitions]
Help me create an evaluation framework for my MCP server. I want to test whether Claude Code can effectively use my tools to answer realistic questions about my API.
أفضل الممارسات
- 优先考虑全面的 API 覆盖而非高级工作流工具,以给予智能体更大的灵活性
- 使用显式的工具定义,包括 title、description、inputSchema 和 annotations
- 使用 Zod(TypeScript)或 Pydantic(Python)设计输入验证以实现运行时类型安全
- 使用评估框架测试你的 MCP 服务器,确保 LLM 能够有效使用你的工具
تجنب
- 避免使用模糊的工具名称,这些名称不能清楚描述所执行的操作
- 不要跳过输入验证——始终使用适当的模式验证用户输入
- 避免从工具返回过于冗长或未过滤的数据——设计聚焦的响应
- 不要使用通用的错误消息——提供可操作的恢复指导