
Mcp Builder
This is a comprehensive methodology for building production-grade MCP servers, covering the full lifecycle from design to deployment. You get concrete guidance on choosing between tools, resources, and prompts, structuring TypeScript and Python projects, and writing tool definitions that AI assistants can actually understand and use correctly. The security section is practical (parameterized queries, path validation, no console.log since it breaks stdio transport), and the testing strategy walks through unit tests, integration tests with the SDK client, and using MCP Inspector for interactive debugging. The deployment checklist and troubleshooting table are useful references when things go wrong. If you're moving past hello-world MCP examples and need to ship something reliable, this gives you the patterns and guardrails to do it right.
- skills.sh installs
- 963
- GitHub stars
- 8.5K
- last updated
- Aug 21, 2026
Install
$ npx -y skills add jnmetacode/superpowers-zh --skill mcp-builder --agent claude-codeInstalls into .claude/skills of the current project.
Files
MCP 服务器构建
系统化设计、实现、测试和部署 Model Context Protocol 服务器的方法论。
1. 协议核心概念
MCP 定义三种原语:
- Tools(工具):AI 助手主动调用的函数,有副作用。如搜索、创建、删除操作。
- Resources(资源):AI 助手只读访问的数据源,用 URI 标识。如
users://{id}/profile。 - Prompts(提示词模板):预定义交互模板,引导用户触发工作流。
选择原则: 执行操作 → Tool | 读取数据 → Resource | 引导交互 → Prompt
2. 项目结构规范
TypeScript
my-mcp-server/
├── src/
│ ├── index.ts # 入口,注册 tools/resources
│ ├── tools/ # 按功能拆分
│ ├── resources/
│ └── lib/ # 客户端封装、校验逻辑
├── tests/
├── package.json
└── tsconfig.json
关键依赖:@modelcontextprotocol/sdk + zod
Python
my-mcp-server/
├── src/my_mcp_server/
│ ├── server.py
│ ├── tools/
│ └── lib/
├── tests/
└── pyproject.toml
关键依赖:mcp + pydantic
3. Tool 设计原则
命名
snake_case格式,动词开头:search_users、create_issue、delete_file- 名称自解释,AI 助手靠名称选工具,模糊命名导致误调用
参数
- 每个参数有类型约束和
.describe()描述 - 可选参数给默认值,减少 AI 决策负担
- 用枚举代替布尔开关
Sponsors
Details
- Repository
- github.com/jnmetacode/superpowers-zh
- Category
- AI & Agent Building
- First seen
- Jun 3, 2026
More from jnmetacode/superpowers-zh
All 20- Workflow Runner952
- Using Superpowers1.2K
- Chinese Documentation1.2K
- Brainstorming1.2K
- Systematic Debugging1.2K
- Receiving Code Review1.1K
- Verification Before Completion1.1K
- Writing Plans1.1K
- Test Driven Development1.1K
- Chinese Code Review1.1K
- Chinese Commit Conventions1K
- Subagent Driven Development1K
- Executing Plans1K
- Requesting Code Review1K
- Finishing A Development Branch993
- Using Git Worktrees987
- Chinese Git Workflow979
- Dispatching Parallel Agents970
- Writing Skills967