Build mcp server

From bobmatnyc/claude-mpm · View interactive version

Build mcp server is an AI agent skill from the GitHub repository bobmatnyc/claude-mpm. Create high-quality MCP servers that enable LLMs to effectively interact with external services. Use when building MCP integrations for APIs or services in Python (FastMCP) or Node/TypeScript (MCP SDK).

How to use this skill

Skill file

MCP Server Development Guide

Overview

Build high-quality MCP (Model Context Protocol) servers that enable LLMs to accomplish real-world tasks through well-designed tools. Quality is measured not by API coverage, but by how effectively agents can use your tools to complete realistic workflows.

Core insight: MCP servers expose tools for AI agents, not human users. Design for agent constraints (limited context, no visual UI, workflow-oriented) rather than human convenience.

When to Use This Skill

Activate when:

Language Support:

The Iron Law

DESIGN FOR AGENTS, NOT HUMANS

Every tool must optimize for:
- Context efficiency (agents have limited tokens)
- Workflow completion (not just API calls)
- Actionable errors (guide agents to success)
- Natural task subdivision (how agents think)

If your tools are just thin API wrappers, you're violating the Iron Law.

Core Principles

  1. Agent-Centric Design First: Study design principles before coding. Tools should enable workflows, not mirror APIs.
  1. Research-Driven Planning: Load MCP docs, SDK docs, and exhaustive API documentation before writing code.
  1. Evaluation-Based Iteration: Create realistic evaluations early. Let agent feedback drive improvements.
  1. Context Optimization: Every response token matters. Default to concise, offer detailed when needed.
  1. Actionable Errors: Error messages should teach agents correct usage patterns.

Quick Start

Phase 1: Research and Planning (40% of effort)

  1. Study Design Principles: Load design_principles.md to understand agent-centric design
  2. Load Protocol Docs: Fetch https://modelcontextprotocol.io/llms-full.txt for MCP specification
  3. Study SDK Docs: Load Python or TypeScript SDK documentation from GitHub
  4. Study API Exhaustively: Read ALL API documentation, endpoints, authentication, rate limits
  5. Create Implementation Plan: Define tools, shared utilities, pagination strategy, error handling

See workflow.md for complete Phase 1 steps.

Phase 2: Implementation (30% of effort)

  1. Setup Project: Create structure following language-specific guide
  2. Build Shared Utilities: API helpers, error handlers, formatters BEFORE tools
  3. Implement Tools: Use Pydantic (Python) or Zod (TypeScript) for validation
  4. Follow Best Practices: Load language-specific guide for patterns

See workflow.md for complete Phase 2 steps and language guides.

Phase 3: Review and Refine (15% of effort)

  1. Code Quality Review: Check DRY, composability, consistency, type safety
  2. Test Build: Verify syntax, imports, build process
  3. Quality Checklist: Use language-specific checklist

See workflow.md for complete Phase 3 steps.

Phase 4: Create Evaluations (15% of effort)

  1. Understand Purpose: Evaluations test if agents can answer realistic questions using your tools
  2. Create 10 Questions: Complex, read-only, independent, verifiable questions
  3. Verify Answers: Solve yourself to ensure stability and correctness
  4. Run Evaluation: Use provided scripts to test agent effectiveness

See evaluation.md for complete evaluation guidelines.

Navigation

Core Design and Workflow

Universal MCP Guidelines

Language-Specific Implementation

Evaluation and Testing

Key Reminders

Red Flags - STOP

If you catch yourself:

ALL of these mean: STOP. Return to design principles and workflow.

Integration with Other Skills

Real-World Impact

From MCP server development experience:


Remember: The quality of an MCP server is measured by how well it enables LLMs to accomplish realistic tasks, not by how comprehensively it wraps an API.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.