Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools
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.
| Principle | Description |
|---|---|
| API Coverage vs. Workflow Tools | Balance comprehensive endpoint coverage with specialized workflow tools. When uncertain, prioritize comprehensive API coverage. |
| Tool Naming & Discoverability | Use consistent prefixes and action-oriented naming (e.g., github_create_issue, github_list_repos). |
| Concise tool descriptions, filter/paginate results, return focused data. |
| Actionable Error Messages | Guide agents toward solutions with specific suggestions and next steps. |
https://modelcontextprotocol.io/sitemap.xml.md for markdown (e.g., https://modelcontextprotocol.io/specification/draft.md)Recommended stack: TypeScript + Streamable HTTP (remote) or stdio (local).
| Resource | URL |
|---|---|
| TypeScript SDK | https://raw.githubusercontent.com/modelcontextprotocol/typescript-sdk/main/README.md |
| Python SDK | https://raw.githubusercontent.com/modelcontextprotocol/python-sdk/main/README.md |
Refer to language-specific guides (TypeScript or Python) for project setup, package.json/tsconfig.json, or module organization.
Create shared utilities:
For each tool:
outputSchema where possiblestructuredContent in tool responses{
"readOnlyHint": true,
"destructiveHint": false,
"idempotentHint": true,
"openWorldHint": false
}
| Language | Build | Test |
|---|---|---|
| TypeScript | npm run build | npx @modelcontextprotocol/inspector |
| Python | python -m py_compile your_server.py | MCP Inspector |
Test whether LLMs can effectively use your MCP server to answer realistic, complex questions.
Each question must be: Independent, Read-only, Complex, Realistic, Verifiable, Stable.
<evaluation>
<qa_pair>
<question>Your complex question here</question>
<answer>Expected answer</answer>
</qa_pair>
<!-- More qa_pairs... -->
</evaluation>
When building MCP servers for the Heady ecosystem:
heady-mcp-gateway-zero-trust skill for secure gateway patternsheady-connector-vault for credential managementservices/) as integration targets.github/workflows/)configs/CONFIG_STANDARDS.md for configuration patterns