tech-mcp-server-dev
Skill240 starsChanged 6 months agoMITView on GitHub
Build MCP (Model Context Protocol) servers including tool definition, schema design, authentication, error handling, and Claude Code integration. Use this skill when the user needs to create an MCP server, expose APIs or databases to AI agents, design tool schemas, or integrate with Claude Code — even if they say 'build an MCP server', 'connect Claude to our database', 'expose our API to AI', or 'create a tool for Claude Code'.
In this repository315 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- algo-ad-biddingSkill
- algo-ad-budgetSkill
- algo-ad-ctrSkill
- algo-ad-gspSkill
- algo-ad-vcgSkill
- algo-blockchain-basicsSkill
- algo-blockchain-smart-contractSkill
- algo-ecom-bm25Skill
- algo-ecom-rankingSkill
- algo-ecom-searchSkill
- algo-forecast-arimaSkill
- algo-forecast-ensembleSkill
- algo-forecast-exponentialSkill
- algo-forecast-prophetSkill
- algo-hr-compensationSkill
- algo-hr-matchingSkill
- algo-hr-turnoverSkill
- algo-mfg-cpkSkill
- algo-mfg-doeSkill
- algo-mfg-fmeaSkill
- algo-mfg-spcSkill
- algo-net-centralitySkill
- algo-net-communitySkill
- algo-net-influenceSkill
- algo-nlp-ldaSkill
- algo-nlp-nerSkill
- algo-nlp-similaritySkill
- algo-nlp-summarizationSkill
- algo-price-bundleSkill
- algo-price-conjointSkill
- algo-price-dynamicSkill
- algo-price-elasticitySkill
- algo-price-van-westendorpSkill
- algo-rank-bayesianSkill
- algo-rank-eloSkill
- algo-rank-trueskillSkill
- algo-rank-wilsonSkill
- algo-rec-cfSkill
- algo-rec-contentSkill
- algo-rec-hybridSkill
- algo-rec-mfSkill
- algo-rec-sessionSkill
- algo-risk-altman-zSkill
- algo-risk-benfordSkill
- algo-risk-creditSkill
- algo-risk-varSkill
- algo-sc-bullwhipSkill
- algo-sc-eoqSkill
- algo-sc-newsvendorSkill
- algo-sc-routingSkill
- algo-sc-safety-stockSkill
- algo-seo-backlinkSkill
- algo-seo-contentSkill
- algo-seo-crawlSkill
- algo-seo-pagerankSkill
- algo-seo-schemaSkill
- algo-seo-technicalSkill
- algo-seo-tfidfSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
8 rules. About 0 are common, 6 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈6
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 80
Test locally with mcp dev or claude mcp add
- Distinctive: line 85
Add error handling for all data operations
- Distinctive: line 86
Add logging for debugging
- Distinctive: line 90
Test with real queries
- Distinctive: line 91
Add to project CLAUDE.md so Claude knows about available tools
- Very specific: line 150
Environment variables for secrets: NEVER hardcode API keys or database passwords.
- Distinctive: line 152
Return data size: Don't return 10,000 rows. The model's context window is limited.
- Distinctive: line 153
Idempotent reads, confirmed writes: Read operations should be safe to call multiple times.
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
MCP Server Development
Framework
IRON LAW: Tools Must Be Self-Describing
Every MCP tool must have a clear name, description, and input schema
that allows the AI model to understand WHEN and HOW to use it without
any external documentation. If the model can't figure out when to call
your tool from its name and description alone, the tool is poorly designed.MCP Architecture
Claude Code / AI Agent
↓ (stdio JSON-RPC 2.0)
MCP Server (your code)
↓
Your Data Source (DB, API, file system, etc.)Protocol Basics
| Concept | What It Is |
| Transport | stdio (stdin/stdout) — most common for local servers |
| Protocol | JSON-RPC 2.0 |
| Tools | Functions the model can call (read data, take actions) |
| Resources | Data the model can read (files, database records) |
| Prompts | Pre-built prompt templates the model can use |
Tool Design Principles
- Atomic operations: Each tool does ONE thing. "search_users" not "search_and_update_users"
- Clear naming: verb_noun format. "get_customer", "create_order", "search_products"
- Descriptive descriptions: Include WHEN to use, not just what it does
- Strict schemas: Define all parameters with types, descriptions, and required/optional
- Meaningful errors: Return error messages the model can understand and act on
Tool Schema Example
{
"name": "search_customers",
"description": "Search for customers by name, email, or phone number. Use when the user asks to find or look up a specific customer.",
"inputSchema": {
"type": "object",
"properties": {
"query": {
"type": "string",
"description": "Search term — can be customer name, email, or phone"
},
"limit": {
"type": "number",
"description": "Maximum results to return (default: 10)",
"default": 10
}
},
"required": ["query"]
}
}Implementation Steps (Python/TypeScript)
Phase 1: Setup
- Choose SDK:
@modelcontextprotocol/sdk(TypeScript) ormcp(Python) - Define tools with schemas
- Implement tool handlers
- Test locally with
mcp devorclaude mcp add
Phase 2: Data Connection 5. Connect to your data source (DB, API, etc.) 6. Implement authentication (env vars for secrets) 7. Add error handling for all data operations 8. Add logging for debugging
Phase 3: Integration
9. Configure in .mcp.json for Claude Code
10. Test with real queries
11. Add to project CLAUDE.md so Claude knows about available tools
.mcp.json Configuration
{
"mcpServers": {
"my-server": {
"command": "node",
"args": ["path/to/server.js"],
"env": {
"DATABASE_URL": "${DATABASE_URL}"
}
}
}
}Error Handling
Tool handler should:
1. Validate input (check required fields, types)
2. Try the operation
3. On success: return structured data (JSON)
4. On error: return { "error": "Human-readable message", "code": "ERROR_CODE" }
- NOT stack traces or internal error details
- The MODEL needs to understand the error to retry or inform the userOutput Format
# MCP Server Spec: {Server Name}
## Purpose
{What data/capability this server exposes}
## Tools
| Tool | Description | Parameters | Returns |
|------|-----------|-----------|---------|
| {name} | {when to use} | {params} | {return type} |
## Data Source
- Type: {database / API / file system}
- Connection: {how to connect}
- Auth: {env vars needed}
## .mcp.json
```json
{config}Testing Plan
- {test case for each tool}
## Gotchas
- **Environment variables for secrets**: NEVER hardcode API keys or database passwords. Use `env` in .mcp.json to pass secrets from environment variables.
- **Tool description quality**: The model decides whether to use your tool based SOLELY on the name + description. A bad description means the tool never gets called (or gets called for wrong reasons).
- **Return data size**: Don't return 10,000 rows. The model's context window is limited. Return summarized or paginated results. Default limit = 10-20 items.
- **Idempotent reads, confirmed writes**: Read operations should be safe to call multiple times. Write operations (create, update, delete) should confirm with the user before execution.
- **Test with real model interactions**: Unit tests aren't enough. The real test is whether Claude actually uses your tool correctly in conversation. Test with diverse prompts.
## References
- For MCP SDK documentation, see `references/mcp-sdk.md`
- For advanced MCP patterns (resources, prompts), see `references/mcp-advanced.md`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.

