MCP Server Registry#

MassGen includes a curated registry of recommended MCP (Model Context Protocol) servers that are automatically available when auto-discovery is enabled.

Overview#

The MCP server registry provides pre-configured, tested MCP servers that extend agent capabilities. When you enable auto_discover_custom_tools: true in your configuration, these servers are automatically included if their API keys are available (or not required).

Registry Location: massgen/mcp_tools/server_registry.py

Available Servers#

Context7#

Purpose: Up-to-date code documentation for libraries and frameworks

Type: stdio (local) or streamable-http (remote)

API Key: Optional (CONTEXT7_API_KEY)

Connection:

mcp_servers:
  - name: "context7"
    type: "stdio"
    command: "npx"
    args: ["-y", "@upstash/context7-mcp"]

Tools:

  • resolve_context7_library_id - Convert library names to Context7 IDs

  • get_library_docs - Fetch version-specific documentation (1K-50K tokens)

Key Features:

  • No API key required for basic use

  • Get API key at https://context7.com/dashboard for higher rate limits

  • Eliminates outdated information and hallucinated APIs

  • Provides current, version-specific documentation

Important Notes:

  • Outputs can be very large (5K-50K tokens)

  • Recommended: Write output to file first, then parse

  • Use topic parameter to narrow results

  • Adjust tokens parameter (default: 5000, max: 50000)

Use Cases:

  • Getting latest framework documentation (React, Next.js, Vue, etc.)

  • Finding current API references

  • Learning about new features in recent versions

  • Avoiding outdated or hallucinated information

Example:

# See: massgen/configs/tools/mcp/context7_documentation_example.yaml

Auto-Discovery#

When auto_discover_custom_tools: true is set in your backend configuration, MassGen automatically includes registry servers that are available:

Always Included:

  • Context7 (no API key required)

Conditionally Included:

  • Brave Search (only if BRAVE_API_KEY is set in .env)

  • Exa Search (only if EXA_API_KEY is set in .env)

Behavior:

  1. Checks which registry servers have required API keys available

  2. Merges available servers into mcp_servers configuration

  3. Avoids duplicates if server is already manually configured

  4. Logs which servers were added and which were skipped

Example:

agents:
  - id: "research_agent"
    backend:
      type: "gemini"
      model: "gemini-2.5-flash"
      auto_discover_custom_tools: true  # Automatically adds registry servers!

Log Output:

[gemini] Auto-discovery enabled: Added MCP servers from registry: context7
[gemini] Registry servers not added (missing API keys): brave_search (needs BRAVE_API_KEY)

Registry Summary Table#

Server

Type

API Key

Rate Limits

Notes

Context7

stdio

Optional

None

Large outputs (write to files). Optional API key for higher rate limits.

Brave Search

stdio

Required

2000/month (free)

Avoid parallel queries. Pro tier available for heavy usage.

Exa Search

stdio

Required

Pay-per-use

AI-powered neural search. Supports category filtering, content extraction, and deep search.

Manual Configuration#

You can manually configure any registry server without auto-discovery:

agents:
  - id: "my_agent"
    backend:
      type: "claude"
      model: "claude-sonnet-4"
      mcp_servers:
        - name: "context7"
          type: "stdio"
          command: "npx"
          args: ["-y", "@upstash/context7-mcp"]

This gives you full control over which servers to include and their configuration.

See Also#