Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools.
To create high-quality MCP (Model Context Protocol) servers that enable LLMs to effectively interact with external services, use this skill. An MCP server provides tools that allow LLMs to access external services and APIs. The quality of an MCP server is measured by how well it enables LLMs to accomplish real-world tasks using the tools provided.
Creating a high-quality MCP server involves four main phases:
Before diving into implementation, understand how to design tools for AI agents by reviewing these principles:
Build for Workflows, Not Just API Endpoints:
schedule_event that both checks availability and creates event)Optimize for Limited Context:
Design Actionable Error Messages:
Follow Natural Task Subdivisions:
Use Evaluation-Driven Development:
Fetch the latest MCP protocol documentation:
Use WebFetch to load: https://modelcontextprotocol.io/llms-full.txt
This comprehensive document contains the complete MCP specification and guidelines.
Load and read the following reference files:
For Python implementations, also load:
https://raw.githubusercontent.com/modelcontextprotocol/python-sdk/main/README.mdFor Node/TypeScript implementations, also load:
https://raw.githubusercontent.com/modelcontextprotocol/typescript-sdk/main/README.mdTo integrate a service, read through ALL available API documentation:
To gather comprehensive information, use web search and the WebFetch tool as needed.
Based on your research, create a detailed plan that includes:
Tool Selection:
Shared Utilities and Helpers:
Input/Output Design:
Error Handling Strategy:
Now that you have a comprehensive plan, begin implementation following language-specific best practices.
For Python:
.py file or organize into modules if complex (see 🐍 Python Guide)For Node/TypeScript:
package.json and tsconfig.jsonTo begin implementation, create shared utilities before implementing tools:
For each tool in the plan:
Define Input Schema:
Write Comprehensive Docstrings/Descriptions:
Implement Tool Logic:
Add Tool Annotations:
readOnlyHint: true (for read-only operations)destructiveHint: false (for non-destructive operations)idempotentHint: true (if repeated calls have same effect)openWorldHint: true (if interacting with external systems)At this point, load the appropriate language guide:
For Python: Load 🐍 Python Implementation Guide and ensure the following:
model_configFor Node/TypeScript: Load ⚡ TypeScript Implementation Guide and ensure the following:
server.registerTool properly.strict()any types - use proper typesnpm run build)After initial implementation:
To ensure quality, review the code for:
Important: MCP servers are long-running processes that wait for requests over stdio/stdin or sse/http. Running them directly in your main process (e.g., python server.py or node dist/index.js) will cause your process to hang indefinitely.
Safe ways to test the server:
timeout 5s python server.pyFor Python:
python -m py_compile your_server.pyFor Node/TypeScript:
npm run build and ensure it completes without errorsTo verify implementation quality, load the appropriate checklist from the language-specific guide:
After implementing your MCP server, create comprehensive evaluations to test its effectiveness.
Load ✅ Evaluation Guide for complete evaluation guidelines.
Evaluations test whether LLMs can effectively use your MCP server to answer realistic, complex questions.
To create effective evaluations, follow the process outlined in the evaluation guide:
Each question must be:
Create an XML file with this structure:
<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>
<!-- More qa_pairs... -->
</evaluation>
Load these resources as needed during development:
https://modelcontextprotocol.io/llms-full.txt - Complete MCP specificationhttps://raw.githubusercontent.com/modelcontextprotocol/python-sdk/main/README.mdhttps://raw.githubusercontent.com/modelcontextprotocol/typescript-sdk/main/README.md🐍 Python Implementation Guide - Complete Python/FastMCP guide with:
@mcp.tool⚡ TypeScript Implementation Guide - Complete TypeScript guide with:
server.registerToolThis is an official skill from Anthropic’s public skills repository. It demonstrates Claude’s capability to handle specialized tasks through structured workflows and domain-specific knowledge.
This skill is available to paid Claude.ai users. Simply reference it in your conversation to activate its capabilities.
Install via the skills marketplace:
# Add the marketplace
/plugin marketplace add anthropics/skills
# Install example skills
/plugin install example-skills@anthropic-agent-skills
Use the Skills API to upload and activate custom skills. See the Skills API documentation for details.
Original skill: mcp-builder
License: Apache 2.0
Development
Free (Apache 2.0)
Specialized agent for actix expert
Expert in Actix for building high-performance web applications with Rust
Expert in Android development, specializing in modern Android practices, optimizing performance, and ensuring robust application architecture.
Expert in Android development, specializing in modern Android practices, optimizing performance, and ensuring robust application architecture. Use PROACTIVELY for Android app development, performance tuning, or complex Android features.
Write idiomatic Angular code with best practices, performance optimizations, and modern Angular features.
Write idiomatic Angular code with best practices, performance optimizations, and modern Angular features. Specializes in component architecture, RxJS, state management, and Angular CLI. Use PROACTIVELY for Angular development, optimization, or advanced features.
Discover more AI and automation tools in The Stockyard
Browse All Resources