building-mcp-servers
Skill12 starsChanged 2 months agoMITView on GitHub
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).
6 other projects use a version of this, 2 of them edited.
Adopted by
Most recently taken up by
- afonsoft/skillsedited, first seen Sep 30, 2026
- osmontero/opencode-skillsedited, first seen Jul 24, 2026
- celigo/aitheir own version, first seen Jul 22, 2026
- AbdullahMalik17/Hacathan_5word for word, first seen Jan 31, 2026
- AbdullahMalik17/My_skillsword for word, first seen Jan 17, 2026
- mjunaidca/mjs-agent-skillsword for word, first seen Dec 21, 2025
Other versions6 projects use a version of this.
Word for word · 3
- mjunaidca/mjs-agent-skills★ 27100% same
- AbdullahMalik17/Hacathan_5★ 9100% same
- AbdullahMalik17/My_skills★ 9100% same
Edited · 2
- osmontero/opencode-skills★ 1422% same
- afonsoft/skills★ 913% same
Wrote their own version · 1
- celigo/ai★ 4same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository60 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- browser-useSkill
- browsing-with-playwrightSkill
- building-chatgpt-appsSkill
- building-chat-interfacesSkill
- building-chat-widgetsSkill
- building-nextjs-appsSkill
- building-rag-systemsSkill
- configuring-better-authSkill
- configuring-dapr-pubsubSkill
- containerizing-applicationsSkill
- context7-efficientSkill
- context-degradationSkill
- context-fundamentalsSkill
- context-optimizationSkill
- creating-skillsSkill
- deploying-cloud-k8sSkill
- deploying-kafka-k8sSkill
- deploying-postgres-k8sSkill
- designing-nextjs-uiSkill
- digital-fte-orchestratorSkill
- doc-coauthoringSkill
- docxSkill
- evaluationSkill
- fetching-library-docsSkill
- generating-ceo-briefingSkill
- installing-skill-trackerSkill
- internal-commsSkill
- managing-calendarSkill
- managing-odooSkill
- managing-servicesSkill
- memory-systemsSkill
- multi-agent-patternsSkill
- nextjs-devtoolsSkill
- nx-monorepoSkill
- operating-k8s-localSkill
- operating-production-servicesSkill
- pdfSkill
- posting-facebookSkill
- posting-instagramSkill
- posting-linkedinSkill
- posting-twitterSkill
- pptxSkill
- project-designerSkill
- researching-with-deepwikiSkill
- scaffolding-fastapi-daprSkill
- scaffolding-openai-agentsSkill
- sending-emailsSkill
- skill-creatorSkill
- streaming-llm-responsesSkill
- styling-with-shadcnSkill
- systematic-debuggingSkill
- theme-factorySkill
- tool-designSkill
- watching-filesystemSkill
- watching-gmailSkill
- watching-whatsappSkill
- working-with-documentsSkill
- working-with-spreadsheetsSkill
- xlsxSkill
The file
We split this skill into the rules it gives an agent
10 rules. 2 are common, 4 are distinctive, and 4 are very specific to this project.
2
Common
Most of the 3 edited versions we read keep these.
4
Distinctive
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Common: line 15
Create MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools.
- Very specific: line 31
Use consistent prefixes (e.g., github_create_issue, github_list_repos) and action-oriented naming.
- Very specific: line 41
Start with the sitemap: https://modelcontextprotocol.io/sitemap.xml
- Common: line 89
Use Zod (TypeScript) or Pydantic (Python)
- Very specific: line 94
Use structuredContent in responses
- Distinctive: line 128
Create 10 evaluation questions to test LLM effectiveness with your server.
- Very specific: line 169
Add /health endpoint via middleware (see references for full example).
- Distinctive: line 181
Run diagnostic: Check references/ folder exists
- Distinctive: line 182
Check: All reference files present
- Distinctive: line 183
Stop and report: if still failing
“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
MCP Server Development Guide
Overview
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.
High-Level Workflow
Creating a high-quality MCP server involves four main phases:
Phase 1: Deep Research and Planning
1.1 Understand Modern MCP Design
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.
1.2 Study MCP Protocol Documentation
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.
1.3 Study Framework Documentation
Recommended stack:
- Language: TypeScript (high-quality SDK, good AI code generation)
- Transport: Streamable HTTP for remote servers, stdio for local servers
Load framework documentation:
- MCP Best Practices - Core guidelines
- TypeScript Guide - TypeScript patterns
- Python Guide - Python/FastMCP patterns
SDK Documentation:
- TypeScript:
https://raw.githubusercontent.com/modelcontextprotocol/typescript-sdk/main/README.md - Python:
https://raw.githubusercontent.com/modelcontextprotocol/python-sdk/main/README.md
1.4 Plan Your Implementation
Review the service's API documentation. List endpoints to implement, starting with most common operations.
Phase 2: Implementation
2.1 Set Up Project Structure
See language-specific guides:
- TypeScript Guide - Project structure, package.json, tsconfig.json
- Python Guide - Module organization, dependencies
2.2 Implement Core Infrastructure
Create shared utilities:
- API client with authentication
- Error handling helpers
- Response formatting (JSON/Markdown)
- Pagination support
2.3 Implement Tools
For each tool:
Input Schema:
- Use Zod (TypeScript) or Pydantic (Python)
- Include constraints and clear descriptions
Output Schema:
- Define
outputSchemawhere possible - Use
structuredContentin responses
Tool Description:
- Concise summary, parameter descriptions, return type
Annotations:
readOnlyHint,destructiveHint,idempotentHint,openWorldHint
Phase 3: Review and Test
3.1 Code Quality
Review for: DRY principle, consistent error handling, full type coverage, clear descriptions.
3.2 Build and Test
TypeScript:
npm run build
npx @modelcontextprotocol/inspectorPython:
python -m py_compile your_server.py
# Test with MCP InspectorPhase 4: Create Evaluations
Create 10 evaluation questions to test LLM effectiveness with your server.
Requirements for each question:
- Independent, read-only, complex, realistic, verifiable, stable
Output Format:
<evaluation>
<qa_pair>
<question>Your question here</question>
<answer>Expected answer</answer>
</qa_pair>
</evaluation>See Evaluation Guide for complete guidelines.
Docker/Containerization
Transport Security (allowed_hosts)
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)Health Check Endpoint
Add /health endpoint via middleware (see references for full example).
Verification
Run: python3 scripts/verify.py
Expected: ✓ building-mcp-servers skill ready
If Verification Fails
- Run diagnostic: Check references/ folder exists
- Check: All reference files present
- Stop and report if still failing
References
- MCP Best Practices - Universal guidelines
- Python Guide - Python/FastMCP patterns
- TypeScript Guide - TypeScript patterns
- TaskFlow Patterns - Internal server patterns
- Evaluation Guide - Creating evaluations
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

