Skip to main content

GAIA MCP Docs Server - Implementation Plan

Status: Planning Priority: Medium View full plan on GitHub β€’ Vote with πŸ‘

Executive Summary

Create an MCP Documentation Server that gives AI coding assistants (Claude Code, Cursor, GitHub Copilot, etc.) intelligent access to GAIA SDK documentation. Instead of web fetches or static context files, the MCP server provides semantic search, code examples on demand, and version-aware documentation. Goal: Make AI assistants expert GAIA developers out of the box.

The Problem

When developers use AI coding assistants to build GAIA agents, the AI lacks context about:
  • SDK patterns and best practices
  • Available tools, mixins, and base classes
  • Correct usage examples
  • Version-specific APIs
Current workarounds are suboptimal:
ApproachLimitation
Web fetchSlow, one page at a time, requires network
Static CLAUDE.mdGets outdated, limited coverage
Copy-paste docsManual, context window bloat

The Solution

An MCP server that exposes GAIA documentation as tools that AI assistants can call:
gaia mcp docs start

Semantic Search

Find relevant docs across all pages β€œHow do I handle errors in tools?”

Code Examples

Get working snippets for any pattern β€œShow me MCPAgent usage”

Version Aware

Returns docs matching installed version Compatible with GAIA 0.15+

MCP Tools

search_docs

Semantic search across all GAIA documentation.
{
  "name": "search_docs",
  "description": "Search GAIA SDK documentation",
  "inputSchema": {
    "type": "object",
    "properties": {
      "query": {
        "type": "string",
        "description": "Natural language search query"
      },
      "category": {
        "type": "string",
        "enum": ["all", "sdk", "guides", "spec", "examples"],
        "default": "all"
      },
      "limit": {
        "type": "integer",
        "default": 5
      }
    },
    "required": ["query"]
  }
}
Example:
Input: {"query": "how to add tools to an agent", "limit": 3}

Output: [
  {"title": "Tool Decorator", "path": "/sdk/core/tools", "snippet": "Use @tool decorator..."},
  {"title": "Agent System", "path": "/sdk/core/agent-system", "snippet": "_register_tools() method..."},
  {"title": "Quickstart", "path": "/quickstart", "snippet": "Define tools inside your agent..."}
]

get_page

Retrieve a specific documentation page.
{
  "name": "get_page",
  "description": "Get full content of a documentation page",
  "inputSchema": {
    "type": "object",
    "properties": {
      "path": {
        "type": "string",
        "description": "Documentation path (e.g., /sdk/core/tools)"
      },
      "section": {
        "type": "string",
        "description": "Optional: specific section heading to extract"
      }
    },
    "required": ["path"]
  }
}

get_code_example

Get working code examples for specific patterns.
{
  "name": "get_code_example",
  "description": "Get code examples for GAIA SDK patterns",
  "inputSchema": {
    "type": "object",
    "properties": {
      "pattern": {
        "type": "string",
        "description": "Pattern name (e.g., 'basic-agent', 'tool-with-error-handling', 'mcp-agent')"
      },
      "language": {
        "type": "string",
        "default": "python"
      }
    },
    "required": ["pattern"]
  }
}
Available patterns:
  • basic-agent - Minimal agent with one tool
  • tool-decorator - @tool usage with parameters
  • tool-error-handling - Error return patterns
  • llm-client-local - Lemonade client setup
  • llm-client-claude - Claude API setup
  • llm-client-openai - OpenAI API setup
  • mcp-agent - MCPAgent mixin usage
  • api-agent - ApiAgent mixin usage
  • rag-basic - RAG SDK initialization
  • rag-query - Document querying

list_components

List available GAIA components with descriptions.
{
  "name": "list_components",
  "description": "List GAIA SDK components",
  "inputSchema": {
    "type": "object",
    "properties": {
      "category": {
        "type": "string",
        "enum": ["agents", "mixins", "tools", "sdks", "all"],
        "default": "all"
      }
    }
  }
}

Architecture

Components

ComponentPurposeImplementation
Doc IndexPreprocessed docs for fast searchMDX files β†’ JSON chunks at build time
Embedding StoreSemantic similarity searchsentence-transformers + FAISS
Code TemplatesWorking examplesJinja2 templates with version tags
Version RegistryAPI compatibilitySemver matching

Integration

Claude Code

Add to ~/.claude/claude_code_config.json:
{
  "mcpServers": {
    "gaia-docs": {
      "command": "gaia",
      "args": ["mcp", "docs", "start"]
    }
  }
}

VSCode (with MCP extension)

Add to .vscode/settings.json:
{
  "mcp.servers": {
    "gaia-docs": {
      "command": "gaia mcp docs start"
    }
  }
}

Cursor

Add to Cursor MCP settings:
{
  "gaia-docs": {
    "command": "gaia mcp docs start"
  }
}

CLI Commands

Start the docs server

# Start MCP docs server
gaia mcp docs start

# Start with custom port
gaia mcp docs start --port 8081

# Start in background
gaia mcp docs start --background

Manage the index

# Rebuild doc index (after GAIA update)
gaia mcp docs index

# Check index status
gaia mcp docs status

# Clear cached embeddings
gaia mcp docs clear-cache

Data Flow

On First Run

On Query


Implementation Plan

1

Foundation

MCP server skeleton, CLI commands (gaia mcp docs start/status), stdio transport
2

Doc Processing

MDX parser, chunk extraction, JSON index builder, bundled with package
3

Search

Embedding generation, FAISS index, search_docs tool implementation
4

Tools

get_page, get_code_example, list_components implementations
5

Templates

Code example templates, version tagging, Jinja2 rendering
6

Integration

Claude Code config generator, VSCode setup, Cursor setup, documentation

Success Metrics

MetricTarget
Search latency< 100ms
Index build time< 30 seconds
Index size< 50 MB
Query relevance (top-3 hit rate)> 80%
Code example accuracy100% (validated at build)

Comparison

FeatureWebFetchStatic CLAUDE.mdMCP Docs Server
Setup requiredNoneDownload fileStart server
Search capabilitySingle pageNoneSemantic across all
SpeedSlow (network)InstantFast (local)
Offline supportNoYesYes
Always currentYesNoYes (with gaia update)
Code examplesManual extractionLimitedOn-demand
Version awareNoNoYes

Why Q2 2026?

This milestone is timed to follow the Lightweight Installer and Chat Desktop UI:
  1. Foundation ready - By Q2, GAIA will have stable installation and core UI, making it easier for new developers to get started
  2. Documentation mature - The SDK docs will be comprehensive and battle-tested
  3. AI assistants mainstream - Claude Code, Cursor, and GitHub Copilot adoption continues to grow
  4. MCP ecosystem expanding - More tools supporting MCP means broader reach
Building the MCP Docs Server after the core experience is polished ensures we’re helping developers with a stable, well-documented SDK.

Future Enhancements

  • Source code search - Search GAIA source, not just docs
  • Interactive examples - Run code snippets and return results
  • Custom docs - Index user’s own agent documentation
  • Multi-language - Support non-Python examples (TypeScript, etc.)

Full Implementation Plan

View the complete technical specification on GitHub