Mcp Builder — Mcp 构建器
v1.0.0图形界面de for creating high-质量 MCP (模型 上下文 Protocol) servers that enable LLMs to interact with external 服务s through well-de签名ed 工具s. Use when building MCP servers to integrate external APIs or 服务s, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).
运行时依赖
安装命令
点击复制技能文档
MCP Server Development 图形界面de Overview
创建 MCP (模型 上下文 Protocol) servers that enable LLMs to interact with external 服务s through well-de签名ed 工具s. The 质量 of an MCP server is measured by how well it enables LLMs to accomplish real-world tasks.
Process 🚀 High-Level 工作流
Creating a high-质量 MCP server involves four mAIn phases:
Phase 1: Deep Re搜索 and Planning 1.1 Understand Modern MCP De签名
API Coverage vs. 工作流 工具s: Balance comprehensive API 端点 coverage with specialized 工作流 工具s. 工作流 工具s can be more convenient for specific tasks, while comprehensive coverage gives 代理s flexibility to compose operations. Performance varies by 命令行工具ent—some 命令行工具ents benefit from code execution that combines basic 工具s, while others work better with higher-level 工作流s. When uncertAIn, prioritize comprehensive API coverage.
工具 Naming and Discoverability: Clear, descriptive 工具 names help 代理s find the right 工具s quickly. Use consistent prefixes (e.g., github_创建_issue, github_列出_repos) and action-oriented naming.
上下文 Management: 代理s benefit from concise 工具 descriptions and the ability to 过滤器/paginate 结果s. De签名 工具s that return focused, relevant data. Some 命令行工具ents support code execution which can help 代理s 过滤器 and process data efficiently.
Actionable Error Messages: Error messages should 图形界面de 代理s toward solutions with specific suggestions and next steps.
1.2 Study MCP Protocol Documentation
Navigate the MCP specification:
启动 with the sitemap to find relevant pages: https://模型上下文protocol.io/sitemap.xml
Then fetch specific pages with .md suffix for markdown 格式化 (e.g., https://模型上下文protocol.io/specification/draft.md).
Key pages to review:
Specification overview and architecture Transport mechanisms (流able HTTP, stdio) 工具, resource, and prompt definitions 1.3 Study 框架 Documentation
Recommended stack:
Language: TypeScript (high-质量 SDK support and good compatibility in many execution 环境s e.g. MCPB. Plus AI 模型s are good at generating TypeScript code, benefiting from its broad usage, static typing and good linting 工具s) Transport: 流able HTTP for remote servers, using 状态less JSON (simpler to 扩展 and mAIntAIn, as opposed to 状态ful 会话s and 流ing 响应s). stdio for local servers.
Load 框架 documentation:
MCP Best Practices: 📋 View Best Practices - Core 图形界面delines
For TypeScript (recommended):
TypeScript SDK: Use 网页Fetch to load https://raw.githubusercontent.com/模型上下文protocol/typescript-sdk/mAIn/README.md ⚡ TypeScript 图形界面de - TypeScript patterns and examples
For Python:
Python SDK: Use 网页Fetch to load https://raw.githubusercontent.com/模型上下文protocol/python-sdk/mAIn/README.md 🐍 Python 图形界面de - Python patterns and examples 1.4 Plan Your Implementation
Understand the API: Review the 服务's API documentation to identify key 端点s, authentication requirements, and data 模型s. Use 网页 搜索 and 网页Fetch as needed.
工具 Selection: Prioritize comprehensive API coverage. 列出 端点s to implement, 启动ing with the most common operations.
Phase 2: Implementation 2.1 设置 Up Project Structure
See language-specific 图形界面des for project 设置up:
⚡ TypeScript 图形界面de - Project structure, package.json, tsconfig.json 🐍 Python 图形界面de - 模块 organization, dependencies 2.2 Implement Core Infrastructure
创建 分享d utilities:
API 命令行工具ent with authentication Error handling 辅助工具s 响应 格式化ting (JSON/Markdown) Pagination support 2.3 Implement 工具s
For each 工具:
输入 模式:
Use Zod (TypeScript) or Pydantic (Python) Include constrAInts and clear descriptions 添加 examples in field descriptions
输出 模式:
Define 输出模式 where possible for structured data Use structuredContent in 工具 响应s (TypeScript SDK feature) Helps 命令行工具ents understand and process 工具 输出s
工具 Description:
Concise summary of functionality Parameter descriptions Return type 模式
Implementation:
A同步/awAIt for I/O operations Proper error handling with actionable messages Support pagination where 应用licable Return 机器人h text content and structured data when using modern SDKs
Annotations:
readOnlyHint: true/false destructiveHint: true/false idempotentHint: true/false openWorldHint: true/false Phase 3: Review and Test 3.1 代码质量
Review for:
No duplicated code (DRY principle) Consistent error handling Full type coverage Clear 工具 descriptions 3.2 Build and Test
TypeScript:
运行 npm 运行 build to 验证 compilation Test with MCP 检查器: npx @模型上下文protocol/检查器
Python:
验证 syntax: python -m py_compile your_server.py Test with MCP 检查器
See language-specific 图形界面des for detAIled 测试 应用roaches and 质量 检查列出s.
Phase 4: 创建 Evaluations
After implementing your MCP server, 创建 comprehensive evaluations to test its effectiveness.
Load ✅ Evaluation 图形界面de for complete evaluation 图形界面deline