Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).
Build high-quality MCP servers that enable LLMs to interact with external services. Use when creating tools for APIs or services in Python or Node/TypeScript, focusing on workflow-driven design and evaluation.
/plugin marketplace add WarrenZhu050413/Warren-Claude-Code-Plugin-Marketplace/plugin install claude-context-orchestrator@warren-claude-code-plugin-marketplaceThis skill inherits all available tools. When active, it can use any tool Claude has access to.
LICENSE.txtreference/evaluation.mdreference/mcp_best_practices.mdreference/node_mcp_server.mdreference/python_mcp_server.mdscripts/connections.pyscripts/evaluation.pyscripts/example_evaluation.xmlscripts/requirements.txtCreate high-quality MCP servers that enable LLMs to effectively interact with external services. Quality is measured by how well LLMs accomplish real-world tasks using the provided tools.
Build for Workflows: Create high-impact workflow tools, not API wrappers. Consolidate operations (e.g., schedule_event checks availability AND creates event).
Optimize for Context: Return high-signal info, not dumps. Offer "concise"/"detailed" options. Use human-readable IDs.
Actionable Errors: Guide agents to correct usage: "Try filter='active_only'". Make errors educational.
Natural Subdivisions: Tool names reflect human thinking. Group with consistent prefixes. Design around workflows.
Evaluation-Driven: Create realistic scenarios early. Iterate based on agent performance.
Load these in order:
https://modelcontextprotocol.io/llms-full.txthttps://raw.githubusercontent.com/modelcontextprotocol/python-sdk/main/README.md + 🐍 Python Guidehttps://raw.githubusercontent.com/modelcontextprotocol/typescript-sdk/main/README.md + ⚡ TypeScript GuideRead ALL: API reference, auth, rate limits, pagination, errors, endpoints, parameters, data models. Use web search and WebFetch.
Tool Selection: List valuable endpoints. Prioritize common use cases. Consider tool combinations.
Shared Utilities: API request patterns, pagination/filtering/formatting helpers, error handling.
Input/Output: Validation (Pydantic/Zod), consistent formats (JSON/Markdown), detail levels (Detailed/Concise), scale planning, character limits (25k tokens).
Error Handling: Graceful failures, actionable LLM-friendly messages, rate limits, timeouts, auth errors.
Python: Single .py or modules. MCP SDK. Pydantic validation.
Node/TypeScript: Project structure (package.json, tsconfig.json). MCP SDK. Zod validation.
Create shared utilities: API helpers, error handling, response formatting (JSON/Markdown), pagination, auth/tokens.
Input Schema: Pydantic/Zod with constraints (min/max, regex, ranges). Clear descriptions with examples.
Descriptions: Summary, purpose, parameter types with examples, return schema, usage examples, error handling with next steps.
Logic: Use shared utilities (DRY). Async/await for I/O. Error handling. Multiple formats (JSON/Markdown). Respect pagination. Check limits, truncate.
Annotations: readOnlyHint, destructiveHint, idempotentHint, openWorldHint.
Python (🐍 Guide): MCP SDK, Pydantic v2 with model_config, type hints, async/await, organized imports, constants.
Node/TypeScript (⚡ Guide): server.registerTool, Zod .strict(), strict mode, no any, explicit Promise<T>, build config.
Check: DRY (no duplication), composability (shared logic), consistency (similar formats), error handling (all calls), type safety (full coverage), documentation (comprehensive).
Important: MCP servers are long-running (stdio/http). Direct runs hang indefinitely.
Safe testing: Evaluation harness (recommended), tmux, or timeout (timeout 5s python server.py).
Python: python -m py_compile your_server.py. Test in tmux or via harness.
Node/TypeScript: npm run build. Verify dist/index.js. Test in tmux or via harness.
See 🐍 Python Guide or ⚡ TypeScript Guide.
Load ✅ Evaluation Guide for complete guidelines.
Process: Tool inspection → content exploration (READ-ONLY) → question generation → answer verification.
Each question: Independent, read-only, complex (multiple tool calls), realistic, verifiable (single answer), stable.
<evaluation>
<qa_pair>
<question>Find discussions about AI model launches with animal codenames. One model needed a specific safety designation that uses the format ASL-X. What number X was being determined for the model named after a spotted wild cat?</question>
<answer>3</answer>
</qa_pair>
</evaluation>
Core: MCP Protocol (https://modelcontextprotocol.io/llms-full.txt), 📋 Best Practices
SDK: Python (https://raw.githubusercontent.com/modelcontextprotocol/python-sdk/main/README.md), TypeScript (https://raw.githubusercontent.com/modelcontextprotocol/typescript-sdk/main/README.md)
Implementation: 🐍 Python, ⚡ TypeScript
Evaluation: ✅ Guide