Skip to content

juancguerrerodev/mcp-excellence-standard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ† MCP Excellence Standard

The comprehensive framework for building AI-agent-optimized Model Context Protocol (MCP) servers.

License: MIT MCP Version Standard Version


🎯 The Problem

Most existing MCPs are built as simple API wrappers without considering the unique constraints of AI agents:

  • Limited context window β†’ Tokens are expensive
  • No persistent memory β†’ State must be managed differently
  • Pattern-matching decisions β†’ Needs clear, consistent interfaces
  • Tendency toward verbose exploration β†’ Requires guardrails

The result? MCPs that waste tokens, require multiple round-trips, and lack safety controls.

πŸ’‘ The Solution

This standard defines best practices across 12 critical dimensions to create MCPs that are efficient, robust, and agent-friendly.


πŸ“– What's Included

File Description
MCP_EXCELLENCE_STANDARD.md The complete standard with detailed patterns and anti-patterns
skills/mcp-excellence/ Claude skill for building standard-compliant MCPs (Anthropic format)
checklists/compliance-checklist.md Quick evaluation checklist for any MCP

πŸ”‘ The 12 Pillars

1. Context Window Optimization

  • returnOnlyIds mode for lists
  • compact mode with minimal fields
  • Cursor-based pagination
  • Count-only operations
  • Summary-only batch responses

2. Atomic vs Composite Operations

  • search_and_action composites
  • get_or_create patterns
  • dryRun preview mode
  • Internal batching

3. Error Handling & Resilience

  • Partial success reporting
  • Structured error responses
  • Internal retry logic
  • Graceful degradation

4. Authentication & Multi-Account

  • Account ID parameters
  • Silent token refresh
  • Device flow support
  • Secure credential storage

5. Discovery & Introspection

  • get_capabilities() tool
  • Enum discovery
  • Rich tool descriptions
  • Schema introspection

6. State & Caching

  • ETag/conditional requests
  • Delta/incremental sync
  • Internal caching with TTL

7. Resource Efficiency

  • Lazy loading / expand parameters
  • Exclude heavy fields by default
  • Truncation with metadata

8. Semantic Grouping

  • {resource}_{action} naming
  • Danger indicators
  • Read/write separation

9. Audit & Observability

  • Action history logging
  • Undo capabilities
  • Change summaries

10. Platform-Specific Patterns

  • Email MCP requirements
  • Calendar MCP requirements
  • File Storage MCP requirements
  • CRM/Database MCP requirements

11. Agent-Friendly Output

  • JSON responses always
  • Consistent schemas
  • Actionable IDs
  • Status enums

12. Safety & Guardrails

  • Maximum batch sizes
  • Two-stage deletion
  • Confirmation tokens
  • Rate limiting
  • Read-only mode

πŸ“Š Compliance Scoring

Use the compliance checklist to evaluate any MCP:

Score Rating
30-36 ⭐⭐⭐⭐⭐ Excellent - Production ready
24-29 ⭐⭐⭐⭐ Good - Minor improvements needed
18-23 ⭐⭐⭐ Adequate - Significant gaps
12-17 ⭐⭐ Poor - Major refactoring needed
0-11 ⭐ Failing - Rebuild recommended

πŸ› οΈ Using the Claude Skill

The included Claude skill follows Anthropic's official skill format with proper YAML frontmatter and progressive disclosure.

Skill Structure

skills/mcp-excellence/
β”œβ”€β”€ SKILL.md              # Main skill file with YAML frontmatter
└── references/
    β”œβ”€β”€ patterns.md       # Detailed implementation patterns
    └── platforms.md      # Platform-specific requirements

Installation

Claude Code: Copy skills/mcp-excellence/ to ~/.claude/skills/

Claude.ai: Zip the folder and upload via Settings > Features

Key Features:

  • Automatic context window optimization
  • Built-in batch operations
  • Error handling patterns
  • Safety guardrails by default

πŸš€ Quick Start

Evaluating an Existing MCP

  1. Open the Compliance Checklist
  2. Score each category
  3. Identify gaps and prioritize improvements

Building a New MCP

  1. Install the skill (see Installation above)
  2. Ask Claude: "Create an MCP for [API name] following the MCP Excellence Standard"
  3. Provide your API documentation
  4. Claude will generate a standard-compliant MCP

Upgrading an Existing MCP

  1. Install the skill
  2. Ask Claude: "Review this MCP and improve it following the MCP Excellence Standard"
  3. Share your existing MCP code
  4. Claude will identify gaps and implement improvements

πŸ’‘ Pro Tips

The skill works for both creating NEW MCPs and IMPROVING existing ones!

Example Prompts

Create a new MCP:

"Create a Gmail MCP following the MCP Excellence Standard with 
context window optimization and batch operations"

Improve an existing MCP:

"Review this MCP code and enhance it following the MCP Excellence 
Standard. Add returnOnlyIds, compact mode, and search_and_action."

Audit an MCP:

"Score this MCP against the MCP Excellence Standard compliance 
checklist and tell me what's missing."

Add specific features:

"Add context window optimization to this MCP - I need returnOnlyIds,
compact mode, and count operations."

When to Use Each Resource

Resource Use For
Skill Let Claude auto-apply best practices while coding
Standard Deep reference for understanding the "why"
Checklist Quick audit of any MCP (yours or third-party)

πŸ“š Examples

Before (Anti-Pattern)

// Returns 500 full email objects
const emails = await mcp.search_emails({ query: "from:newsletter" });
// Then loops to delete each one
for (const email of emails) {
  await mcp.delete_email({ id: email.id });
}
// Result: 501 API calls, ~50,000 tokens consumed

After (Excellence Standard)

// Single composite operation with preview
const result = await mcp.search_and_action({
  query: "from:newsletter",
  action: "trash",
  dryRun: false
});
// Result: 1 API call, ~100 tokens consumed
// Returns: { processed: 247, failed: 0 }

🀝 Contributing

This is a living standard. Contributions welcome!

  1. Fork the repository
  2. Create a feature branch
  3. Submit a pull request

Areas for Contribution:

  • New platform-specific patterns
  • Reference implementations
  • Linting tools
  • Additional language examples

πŸ“„ License

MIT License - See LICENSE for details.


πŸ‘€ Author

Juan C. Guerrero

Founder of Blockchain Jungle | Co-founder of Dojo Coding & All Time High


πŸ™ Acknowledgments

This standard was developed through hands-on experience building and enhancing multiple MCPs, identifying patterns that waste AI agent resources, and synthesizing best practices that the industry was lacking.


"An MCP is not a human API. It's an interface for an AI agent with unique constraints and capabilities. Design accordingly."

About

πŸ† The comprehensive framework for building AI-agent-optimized Model Context Protocol (MCP) servers. Includes best practices, compliance checklist, and enhanced Claude skill for MCP development.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors