4.6 — Production MCP Patterns
Pattern 1: Server-Per-Domain (Avoid Tool Flooding)
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 UnlockFree access · No credit card required