Guide developers in creating Model Context Protocol (MCP) servers. Use for building MCP tools that enable LLMs to interact with external services. Covers TypeScript (primary) and Python FastMCP (secondary), tool annotations, Zod/Pydantic validation, and evaluation question creation.
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
A direct command skips the review prompt. Inspect the source before running it.
Guide developers in creating Model Context Protocol (MCP) servers. Use for building MCP tools that enable LLMs to interact with external services. Covers TypeScript (primary) and Python FastMCP (secondary), tool annotations, Zod/Pydantic validation, and evaluation question creation.
["Study MCP protocol docs before implementing any server","TypeScript is strongly preferred for its high-quality SDK support","Use streamable HTTP for remote servers, stdio for local servers","Validate all inputs with Zod (TypeScript) or Pydantic (Python)","Annotate tools with readOnlyHint, destructiveHint, idempotentHint, openWorldHint","Create 10 independent evaluation questions per server"]
error_handling
strict
streaming
supported
source
builtin
trust_score
100
provenance_sha
45d11b9bdbe993f2
MCP Server Development Guide
"The quality of an MCP server is measured by how well it enables LLMs to accomplish real-world tasks."
Overview
This skill guides you through creating Model Context Protocol (MCP) servers โ tools that enable LLMs to interact with external services. MCP servers expose capabilities as typed tools that agents can discover and invoke.
When to Invoke
User asks to "build an MCP server" or "create MCP tools"
Integrating an external API with Claude
Exposing local system capabilities (files, databases, services) to an agent
Creating tools for an agent to call
Four-Phase Development Workflow
Phase 1: Deep Research and Planning
Before writing any code, understand the target API or service thoroughly.
Study MCP protocol documentation
Visit https://modelcontextprotocol.io/sitemap.xml for current docs
Understand tool definitions, resource types, and prompt patterns
Analyze the target service
What operations does the API support?
Which operations are read-only vs destructive?
What are the authentication requirements?
What are the rate limits and pagination patterns?
Design tool coverage
Balance: API coverage (breadth) vs workflow tools (depth, combining multiple API calls)
Prefer workflow tools for common agent tasks
Design tool names as snake_case verb-noun pairs: get_user, create_issue, list_repos
Choose transport
Remote servers: Streamable HTTP transport
Local servers: stdio transport
Default to stdio unless there's a specific need for HTTP
Phase 2: Implementation
Language Selection
TypeScript (recommended) โ high-quality SDK, strong type safety, better IDE support:
Design 10 independent evaluation questions per server. These test whether the MCP server enables real-world tasks.
Evaluation question requirements:
Each question is independent (no prior context needed)
Questions use realistic scenarios an agent would encounter
Questions are specific enough to have verifiable answers
Mix of simple (1 tool call) and compound (2-3 tool calls) tasks
At least 3 questions test read-only operations
At least 2 questions test error handling
Output format:
<evaluations><questionid="1"><task>Get the description of the 'anthropics/claude-code' repository</task><expected_tools>get_repository</expected_tools><answer>Claude Code is Anthropic's official CLI for Claude</answer></question><questionid="2"><task>List the open issues labeled 'bug' in 'anthropics/claude-code', limit to 5</task><expected_tools>list_issues</expected_tools><answer>Returns up to 5 open issues with 'bug' label</answer></question><!-- ... 8 more questions --></evaluations>
The modelcontextprotocol/servers repository provides production-ready reference implementations. Use these as starting templates before building custom servers.
PostgreSQL MCP Server
# Install and run directly
npx -y @modelcontextprotocol/server-postgres postgresql://localhost/mydb
Cross-IDE Agent Detection (Inspired by Skill_Seekers AgentDetector)
After building an MCP server, auto-detect which AI coding agents are installed on the user's system and generate the correct configuration for each. This eliminates the manual "copy this JSON into your settings" step.