.claude/skills/building-mcp-servers/SKILL.md
Guides creation of 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). Covers tool design, authentication, Docker deployment, and evaluation creation. NOT when consuming existing MCP servers (use the server directly).
npx skillsauth add Asmayaseen/hackathon-2 building-mcp-serversInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Create MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. The quality of an MCP server is measured by how well it enables LLMs to accomplish real-world tasks.
Creating a high-quality MCP server involves four main phases:
API Coverage vs. Workflow Tools: Balance comprehensive API endpoint coverage with specialized workflow tools. When uncertain, prioritize comprehensive API coverage.
Tool Naming and Discoverability:
Use consistent prefixes (e.g., github_create_issue, github_list_repos) and action-oriented naming.
Context Management: Design tools that return focused, relevant data. Support filtering/pagination.
Actionable Error Messages: Error messages should guide agents toward solutions with specific suggestions.
Start with the sitemap: https://modelcontextprotocol.io/sitemap.xml
Fetch pages with .md suffix (e.g., https://modelcontextprotocol.io/specification/draft.md).
Key pages: Specification overview, transport mechanisms, tool/resource/prompt definitions.
Recommended stack:
Load framework documentation:
SDK Documentation:
https://raw.githubusercontent.com/modelcontextprotocol/typescript-sdk/main/README.mdhttps://raw.githubusercontent.com/modelcontextprotocol/python-sdk/main/README.mdReview the service's API documentation. List endpoints to implement, starting with most common operations.
See language-specific guides:
Create shared utilities:
For each tool:
Input Schema:
Output Schema:
outputSchema where possiblestructuredContent in responsesTool Description:
Annotations:
readOnlyHint, destructiveHint, idempotentHint, openWorldHintReview for: DRY principle, consistent error handling, full type coverage, clear descriptions.
TypeScript:
npm run build
npx @modelcontextprotocol/inspector
Python:
python -m py_compile your_server.py
# Test with MCP Inspector
Create 10 evaluation questions to test LLM effectiveness with your server.
Requirements for each question:
Output Format:
<evaluation>
<qa_pair>
<question>Your question here</question>
<answer>Expected answer</answer>
</qa_pair>
</evaluation>
See Evaluation Guide for complete guidelines.
FastMCP validates Host headers. For Docker, configure:
from mcp.server.fastmcp import FastMCP
from mcp.server.transport_security import TransportSecuritySettings
transport_security = TransportSecuritySettings(
allowed_hosts=[
"127.0.0.1:*", "localhost:*", "[::1]:*",
"mcp-server:*", # Docker container name
"0.0.0.0:*",
],
)
mcp = FastMCP("my_server", transport_security=transport_security)
Add /health endpoint via middleware (see references for full example).
Run: python3 scripts/verify.py
Expected: ✓ building-mcp-servers skill ready
development
Systematic methodology for debugging bugs, test failures, and unexpected behavior. Use when encountering any technical issue before proposing fixes. Covers root cause investigation, pattern analysis, hypothesis testing, and fix implementation. Use ESPECIALLY when under time pressure, "just one quick fix" seems obvious, or you've already tried multiple fixes. NOT for exploratory code reading.
development
Build beautiful, accessible UIs with shadcn/ui components in Next.js. Use when creating forms, dialogs, tables, sidebars, or any UI components. Covers installation, component patterns, react-hook-form + Zod validation, and dark mode setup. NOT when building non-React applications or using different component libraries.
tools
Implement real-time streaming UI patterns for AI chat applications. Use when adding response lifecycle handlers, progress indicators, client effects, or thread state synchronization. Covers onResponseStart/End, onEffect, ProgressUpdateEvent, and client tools. NOT when building basic chat without real-time feedback.
tools
Builds AI agents using OpenAI Agents SDK with async/await patterns and multi-agent orchestration. Use when creating tutoring agents, building agent handoffs, implementing tool-calling agents, or orchestrating multiple specialists. Covers Agent class, Runner patterns, function tools, guardrails, and streaming responses. NOT when using raw OpenAI API without SDK or other agent frameworks like LangChain.