mcp-builder
Guide for creating 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).
What this skill does
# MCP Server Development
Build MCP servers that enable LLMs to accomplish real-world tasks through well-designed tools.
## 4-Phase Process
**Research → Implement → Review → Evaluate**
Load resources on-demand (progressive disclosure):
- Protocol: `https://modelcontextprotocol.io/specification/2025-11-25` (latest spec)
- Legacy Protocol: `https://modelcontextprotocol.io/llms-full.txt` (for reference)
- Python SDK: `https://raw.githubusercontent.com/modelcontextprotocol/python-sdk/main/README.md`
- TypeScript SDK: `https://raw.githubusercontent.com/modelcontextprotocol/typescript-sdk/main/README.md`
## Core Design Principles
**Workflows over endpoints**: Consolidate operations (e.g., `schedule_event` checks availability + creates)
**Optimize context**: Return high-signal info, provide `concise`/`detailed` formats, use readable IDs
**Actionable errors**: Guide to correct usage ("Try filter='active_only'"), suggest next steps
**Natural task flow**: Name tools how humans think, group with consistent prefixes
**Searchable at scale**: Rich descriptions, semantic keywords, clear naming for tool discovery (20+ tools)
---
## Phase 1: Research & Planning
**1.1 Core Docs**
- Load protocol: `https://modelcontextprotocol.io/specification/2025-11-25`
- Read [Best Practices](./reference/mcp_best_practices.md)
**1.2 Framework** (choose one)
- Python: Fetch SDK + read [Python Guide](./reference/python_mcp_server.md)
- TypeScript: Fetch SDK + read [TypeScript Guide](./reference/node_mcp_server.md)
**1.3 API Research**
Study exhaustively: auth, rate limits, pagination, endpoints, errors, schemas
**1.4 Plan**
- Tool selection (most valuable endpoints)
- Shared utilities (requests, pagination, formatting, errors)
- I/O design (validation schemas, response formats, 25k char limits)
- Error strategy (graceful failures, actionable messages)
**1.5 Tool Organization for Scale**
- Load [Tool Search Guide](./reference/tool_search_patterns.md) for servers with 20+ tools
- Plan tool discoverability: clear names, rich descriptions, semantic keywords
---
## Phase 2: Implementation
**2.1 Structure**
Python: single `.py` or modules | TypeScript: `package.json` + `tsconfig.json`
**2.2 Infrastructure First**
Build shared utilities: API helpers, error handling, formatting, pagination, auth
See: [examples/basic-server.py](./examples/basic-server.py) or [.ts](./examples/basic-server.ts)
**2.3 Tools** (for each):
- **Schema**: Pydantic/Zod with constraints, clear descriptions
- **Docs**: Summary, purpose, params+examples, returns, usage, errors
- **Code**: Use utilities, async/await, multiple formats, respect limits
See: [examples/tool-with-context.py](./examples/tool-with-context.py), [error-handling.py](./examples/error-handling.py)
**2.4 Best Practices**
Python: `@mcp.tool()`, Pydantic v2, type hints, async/await, constants
TypeScript: `registerTool()`, Zod `.strict()`, strict mode, no `any`, `Promise<T>`
---
## Phase 3: Review & Refine
**3.1 Quality**: Check DRY, composability, consistency, error handling, types, docs
**3.2 Test**: MCP servers are long-running. See [testing.md](./reference/testing.md)
Quick check: `python -m py_compile server.py` or `npm run build`
**3.3 Checklist**: Load from [Python](./reference/python_mcp_server.md) or [TypeScript](./reference/node_mcp_server.md) guide
---
## Phase 4: Evaluations
Test LLM effectiveness with your server.
**Process**: Inspect tools → Explore data → Generate 10 questions → Verify answers
**Requirements**: Independent, read-only, complex, realistic, verifiable, stable
**Format**:
```xml
<evaluation>
<qa_pair>
<question>Complex question...</question>
<answer>Verifiable answer</answer>
</qa_pair>
</evaluation>
```
Complete guide: [evaluation.md](./reference/evaluation.md)
---
## Reference Library
| Resource | Load | Purpose |
|----------|------|---------|
| [Best Practices](./reference/mcp_best_practices.md) | Phase 1 | Universal guidelines |
| [Tool Search Patterns](./reference/tool_search_patterns.md) | Phase 1 (20+ tools) | Lazy loading & discoverability |
| [Python Guide](./reference/python_mcp_server.md) | Phase 1/2 | Python patterns |
| [TypeScript Guide](./reference/node_mcp_server.md) | Phase 1/2 | TypeScript patterns |
| [Testing](./reference/testing.md) | Phase 3 | Safe testing |
| [Evaluation](./reference/evaluation.md) | Phase 4 | Creating evals |
## Examples
| File | Purpose |
|------|---------|
| [basic-server.py](./examples/basic-server.py) | Python structure |
| [basic-server.ts](./examples/basic-server.ts) | TypeScript structure |
| [tool-with-context.py](./examples/tool-with-context.py) | Workflows |
| [error-handling.py](./examples/error-handling.py) | Errors |
| [searchable-tools.py](./examples/searchable-tools.py) | Tool organization (20+ tools) |
| [searchable-tools.ts](./examples/searchable-tools.ts) | Tool organization (20+ tools) |
---
## Success Criteria
- Clear tool boundaries (single purpose)
- Efficient context (concise defaults)
- Educational errors (guide usage)
- Workflow optimization (consolidate steps)
- Production ready (errors, rate limits, logging)
- Agent effective (90%+ eval success)
Related in Backend & APIs
jfrog
IncludedInteract with the JFrog Platform via the JFrog CLI and REST/GraphQL APIs. Use this skill when the user wants to manage Artifactory repositories, upload or download artifacts, manage builds, configure permissions, manage users and groups, work with access tokens, configure JFrog CLI servers, search artifacts, manage properties, set up replication, manage JFrog Projects, run security audits or scans, look up CVE details, query exposures scan results from JFrog Advanced Security, manage release bundles and lifecycle operations, aggregate or export platform data, or perform any JFrog Platform administration task. Also use when the user mentions jf, jfrog, artifactory, xray, distribution, evidence, apptrust, onemodel, graphql, workers, mission control, curation, advanced security, exposures, or any JFrog product name.
cupynumeric-migration-readiness
IncludedPre-migration readiness assessor for porting NumPy to cuPyNumeric. Use BEFORE substantial porting work begins when the user asks whether code will scale on GPU, whether they should migrate to cuPyNumeric, which NumPy patterns transfer cleanly, what must be refactored before porting, or mentions pre-port assessment, scaling analysis, or refactor planning. Inspect the user's source code, look up NumPy usage, cross-reference the cuPyNumeric API support manifest, and distinguish distributed-scaling-friendly patterns from blockers such as unsupported APIs, scalar synchronization, host round-trips, Python/object-heavy control flow, shape/data-dependent branching, and in-place mutation hazards. Produce a verdict of READY, LIGHT REFACTOR, SIGNIFICANT REFACTOR, or NOT RECOMMENDED, with concrete refactor pointers.
alibabacloud-data-agent-skill
IncludedInvoke Alibaba Cloud Apsara Data Agent for Analytics via CLI to perform natural language-driven data analysis on enterprise databases. Data Agent for Analytics is an intelligent data analysis agent developed by Alibaba Cloud Database team for enterprise users. It automatically completes requirement analysis, data understanding, analysis insights, and report generation based on natural language descriptions. This tool supports: discovering data resources (instances/databases/tables) managed in DMS, initiating query or deep analysis sessions, real-time progress tracking, and retrieving analysis conclusions and generated reports. Use this Skill when users need to query databases, analyze data trends, generate data reports, ask questions in natural language, or mention "Data Agent", "data analysis", "database query", "SQL analysis", "data insights".
token-optimizer
IncludedReduce OpenClaw token usage and API costs through smart model routing, heartbeat optimization, budget tracking, and native 2026.2.15 features (session pruning, bootstrap size limits, cache TTL alignment). Use when token costs are high, API rate limits are being hit, or hosting multiple agents at scale. The 4 executable scripts (context_optimizer, model_router, heartbeat_optimizer, token_tracker) are local-only — no network requests, no subprocess calls, no system modifications. Reference files (PROVIDERS.md, config-patches.json) document optional multi-provider strategies that require external API keys and network access if you choose to use them. See SECURITY.md for full breakdown.
resend-cli
IncludedUse this skill when the task is specifically about operating Resend from an AI agent, terminal session, or CI job via the official resend CLI: installing/authenticating the CLI, sending/listing/updating/cancelling emails, batch sends, domains and DNS, webhooks and local listeners, inbound receiving, contacts, topics, segments, broadcasts, templates, API keys, profiles, or debugging Resend CLI/API failures. Trigger on mentions of Resend CLI, `resend`, `resend doctor`, `resend emails send`, `resend domains`, `resend webhooks listen`, `resend emails receiving`, or agent-friendly terminal automation.
alibabacloud-odps-maxframe-coding
IncludedUse this skill for MaxFrame SDK development and documentation navigation on Alibaba Cloud MaxCompute (ODPS). Helps answer MaxFrame API, concept, official example, and supported pandas API questions; create data processing programs; read/write MaxCompute tables; debug jobs (remote or local); and build custom DPE runtime images. Trigger when users mention MaxFrame, MaxCompute with MaxFrame, ODPS table processing, DPE runtime, MaxFrame docs/examples, DataFrame/Tensor operations, or GPU runtime setup. Works for both English and Chinese queries about Alibaba Cloud data processing with MaxFrame.