1:1 Mentoring with Big Tech AI Engineers
RAG & MCP

4.6 — Production MCP Patterns

Pattern 1: Server-Per-Domain (Avoid Tool Flooding)

Server-Per-Domain Pattern
Rule of Thumb: Keep each MCP server to 5-10 tools max. Beyond 15-20 tools, model accuracy for tool selection drops significantly. If you have 50 tools across 5 domains, build 5 servers of 10 tools each — the model selects better, and you can deploy/update each domain independently.

Pattern 2: Tool Versioning

# Version your tools to prevent schema drift
@mcp.tool()
def create_ticket_v2(
    account_id: str,
    summary: str,
    priority: str,
    labels: list[str] = None  # New field in v2
) -> dict:
    """Create a support ticket (v2 — supports labels).
    Supersedes create_ticket. Use this version for all new ticket creation."""
    ...

# Deprecation: keep old version with redirect notice
@mcp.tool()
def create_ticket(account_id: str, summary: str, priority: str) -> dict:
    """[DEPRECATED] Use create_ticket_v2 instead. Creates a support ticket."""
    return create_ticket_v2(account_id, summary, priority)

Pattern 3: Human-in-the-Loop for Destructive Operations

Continue Reading

This topic continues with more in-depth content, code examples, and diagrams. Sign up free to unlock the full guide with all 87 sections.

Sign Up Free to Unlock

Free access · No credit card required

More in RAG & MCP

Get full access to all 87 sections with code examples, diagrams, and interactive animations.

Sign Up Free