MCP 服务器构建指南
mcp-builder
创建高质量 MCP(Model Context Protocol,模型上下文协议)服务器的指南。
- License 许可
- AGPL-3.0
- 最近更新
- 2026-11-13
- Stars
- ★ 13
- Forks
- 2
01 前言 Front Matter
- name
- mcp-builder
- description
- Guide for creating high-quality MCP (Model Context Protocol) servers.
02 资源文件 5
- 参考文档references/accessibility.md4.2 KB
- 参考文档references/labels-and-layout.md5.8 KB
- 参考文档references/plain-english.md8.5 KB
- 参考文档references/tokens.md6.6 KB
- 参考文档references/typography.md3.5 KB
03 SKILL.md 正文
MCP Server Development Guide
Overview
Create MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools.
High-Level Workflow
Phase 1: Deep Research and Planning
- Understand Modern MCP Design:
- Balance API coverage vs workflow tools.
- Use clear, descriptive tool names (e.g.,
github_create_issue). - Provide concise tool descriptions and actionable error messages.
- Study Documentation:
- Protocol Specs:
https://modelcontextprotocol.io/specification/draft.md - Best Practices:
[? View Best Practices](./reference/mcp_best_practices.md)
- Protocol Specs:
- Choose Stack:
- TypeScript (Recommended): High-quality SDK, strong typing.
- Python: Good for data/ML heavy integration.
- Plan Implementation:
- Review service API.
- Select tools to implement (common operations first).
Phase 2: Implementation
- Project Structure:
- TypeScript:
package.json,tsconfig.json,src/index.ts. - Python:
pyproject.toml,server.py.
- TypeScript:
- Core Infrastructure:
- Auth, Error handling, Pagination.
- Implement Tools:
- Input Schema: Zod (TS) or Pydantic (Python).
- Output Schema: Structured data + text.
- Description: Summary, parameters, return type.
- Annotations:
readOnlyHint,destructiveHint.
Phase 3: Review and Test
- Code Quality: DRY, Error handling, Type coverage.
- Build:
npm run buildorpy_compile. - Test: Use
npx @modelcontextprotocol/inspector.
Phase 4: Evaluations
- Create 10 independent, read-only, complex questions to verify the server.
- Format as XML evaluations.
Reference Files
(Note: Source references are available in external/skills_repos/anthropic-skills/skills/mcp-builder/reference)
04 同仓库更多 Skills
Rust TDD 开发工作流
tdd-rust
面向 RTK 过滤器开发的 TDD 工作流。采用符合 Rust 惯用法的红-绿-重构(Red-Green-Refactor)流程。使用真实测试夹具、token 节省断言,以及基于 insta 的快照测试。在实现新过滤器时自动触发。
构建提交与发布自动化
ship
构建、提交、推送与版本升级工作流——自动化完整的发布周期。
RTK CLI 安全守卫
security-guardian
面向 RTK 的 CLI 安全专家——涵盖命令注入、shell 转义与 hook 安全。
RTK 完整分诊分析
rtk-triage
RTK 完整分诊:并行执行 issue-triage 与 pr-triage,随后交叉比对数据,检测重复覆盖、安全漏洞、无 PR 的 P0 问题及内部冲突。结果保存至 claudedocs/RTK-YYYY-MM-DD.md。参数:"en"/"fr" 指定语言(默认 fr),"save" 强制保存。
Rust TDD 测试驱动开发
rtk-tdd
为 Rust 开发强制推行 TDD(红-绿-重构)。在实现、测试、重构和缺陷修复任务中自动触发。提供符合 Rust 习惯的测试模式,涵盖 anyhow/thiserror、cfg(test) 以及 Arrange-Act-Assert 工作流。
代码仓库回顾报告
repo-recap
生成全面的代码仓库回顾报告(PR、issue、release),用于与团队分享。传入 "en" 或 "fr" 作为参数指定语言(默认为 fr)。