一键导入
mcp-builder
MCP (Model Context Protocol) server building principles. Tool design, resource patterns, best practices.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
MCP (Model Context Protocol) server building principles. Tool design, resource patterns, best practices.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
How to author a DESIGN.md file — the machine-readable design-token + human-rationale format that must exist before any UI is built. YAML front-matter token schema (colors, typography, spacing, rounded, components), type system, token references, and canonical section order.
How to organize frontend code — separation of concerns (UI / logic / data / type), file responsibility, state tiers, API services, schema validation, and framework conventions for React/Next and Vue. Structural rules, not visual design.
Anti-slop frontend design for web UI — landing pages, portfolios, marketing/product sites, and redesigns. Reads the brief, infers the right direction, and ships interfaces that don't look templated. Real design systems when applicable, audit-first on redesigns, strict pre-flight check. NOT for mobile apps.
Automatic agent selection and intelligent task routing. Analyzes user requests and automatically selects the best specialist agent(s) without requiring explicit user mentions.
AI operational modes (brainstorm, implement, debug, review, teach, ship, orchestrate). Use to adapt behavior based on task type.
Socratic questioning protocol + user communication. MANDATORY for complex requests, new features, or unclear requirements. Includes progress reporting and error handling.
| name | mcp-builder |
| description | MCP (Model Context Protocol) server building principles. Tool design, resource patterns, best practices. |
| when_to_use | When building MCP (Model Context Protocol) servers, designing MCP tools, or implementing MCP resource patterns. |
| allowed-tools | Read, Write, Edit, Glob, Grep |
Principles for building MCP servers.
Model Context Protocol - standard for connecting AI systems with external tools and data sources.
| Concept | Purpose |
|---|---|
| Tools | Functions AI can call |
| Resources | Data AI can read |
| Prompts | Pre-defined prompt templates |
my-mcp-server/
├── src/
│ └── index.ts # Main entry — McpServer from @modelcontextprotocol/sdk
├── package.json # dep: @modelcontextprotocol/sdk
└── tsconfig.json
TypeScript SDK:
@modelcontextprotocol/sdk(McpServer). Python SDK:mcp(pip install "mcp[cli]",FastMCPbundled inmcp.server.fastmcp).
| Type | Use |
|---|---|
| stdio | Local, CLI-based |
| Streamable HTTP | Remote/web servers (replaced the deprecated HTTP+SSE transport) |
The current spec (2025-06-18) defines two standard transports: stdio and Streamable HTTP. WebSocket is not a standard transport. Validate the
Originheader on Streamable HTTP servers.
| Principle | Description |
|---|---|
| Clear name | Action-oriented (get_weather, create_user) |
| Single purpose | One thing well |
| Validated input | Schema with types and descriptions |
| Structured output | Predictable response format |
| Field | Required? |
|---|---|
| Type | Yes - object |
| Properties | Define each param |
| Required | List mandatory params |
| Description | Human-readable |
| Type | Use |
|---|---|
| Static | Fixed data (config, docs) |
| Dynamic | Generated on request |
| Template | URI with parameters |
| Pattern | Example |
|---|---|
| Fixed | docs://readme |
| Parameterized | users://{userId} |
| Collection | files://project/* |
| Situation | Response |
|---|---|
| Invalid params | Validation error message |
| Not found | Clear "not found" |
| Server error | Generic error, log details |
| Type | Encoding |
|---|---|
| Text | Plain text |
| Images | Base64 + MIME type |
| Files | Base64 + MIME type |
| Field | Purpose |
|---|---|
| command | Executable to run (stdio servers) |
| args | Command arguments |
| env | Environment variables |
MCP is multi-client — the same server works across Claude Desktop, Claude Code, and IDE hosts. Remote (Streamable HTTP) servers authenticate via OAuth rather than a local command.
Worth using in modern servers (spec 2025-06-18):
| Feature | Purpose |
|---|---|
| Tool annotations | Hint read-only/destructive behavior to the client |
Structured content / outputSchema | Typed, predictable tool results |
| Resource links | Return references to resources from tool results |
| OAuth | Auth for remote/Streamable HTTP servers |
| Type | Focus |
|---|---|
| Unit | Tool logic |
| Integration | Full server |
| Contract | Schema validation |
Remember: MCP tools should be simple, focused, and well-documented. The AI relies on descriptions to use them correctly.