MCP Documentation Index
Overview
Aitana implements Model Context Protocol (MCP) in multiple ways to enable tool integration with AI assistants. This index helps you find the right documentation for your needs.
Quick Navigation
🚀 I want to…
Use MCP with Claude Desktop/Code
➡️ MCP Claude Integration Guide
- Setup instructions for Claude Desktop and Claude Code
- Launcher scripts and configuration
- Client detection features
Understand the complete MCP architecture
➡️ MCP Complete Architecture Guide
- Full technical overview
- Terminology explanations
- API flow analysis
- Troubleshooting guide
Get quick commands and setup
- Common commands
- Quick setup steps
- Key endpoints
- Test examples
Understand FastAPI/Sunholo integration
➡️ MCP Integration Guide - Sunholo Patterns
- VACRoutesFastAPI patterns
- Decorator-based tool registration
- SSE streaming support
Review technical implementation details
➡️ Backend MCP Integration Architecture
- Server implementations
- Client detection system
- stdio compatibility layer
- Performance considerations
Key Concepts Summary
MCP Integration Types
| Type | Description | Use Case | Documentation |
|---|---|---|---|
| Claude Direct | stdio server for Claude Desktop/Code | Using Aitana tools in Claude | Claude Integration |
| Native API Tools | Direct Python functions | Backend services | Architecture Guide |
| Registered MCP | Pre-configured MCP servers | Permanent integrations | Complete Guide |
| Dynamic MCP | Runtime-configured connections | External services | Architecture Guide |
MCP Server vs Client
| Component | Role | Examples | Location |
|---|---|---|---|
| MCP Server | Provides tools | demo_server.py, mcp_stdio.py |
backend/tools/mcp_tools/ |
| MCP Client | Connects to servers | mcp_client.py, Claude Desktop |
backend/tools/mcp_client.py |
Tool Categories
- Native API Tools
- Direct Python functions (
google_search,ai_search) - Location:
backend/tools/ - No MCP protocol involved
- Direct Python functions (
- Registered MCP Servers (
mcp_*prefix)- Pre-configured in
mcp_servers.py - Examples:
mcp_demo,mcp_database - Permanent, named tools
- Pre-configured in
- Dynamic MCP Connections (
external_mcp)- Runtime configuration
- Connect to any MCP server
- Flexible, temporary connections
File Organization
Core MCP Files
backend/mcp_server_claude_desktop.sh- Main launcher scriptbackend/mcp_stdio.py- Claude Desktop stdio serverbackend/mcp_stdio_compat.py- Claude Code compatibilitybackend/mcp_tools.py- Tool registry
Infrastructure
backend/tools/mcp_client.py- MCP client managerbackend/tools/mcp_servers.py- Server registrybackend/tools/mcp_registry.py- Server managementbackend/tools/mcp_tool_discovery.py- Tool discovery
Server Implementations
backend/tools/mcp_tools/demo_server.py- Demo server (with inline dependencies)backend/tools/mcp_tools/template_server.py- Server template
Key Insights from Testing
cwdparameter doesn’t work reliably in Claude Desktop configuration- Use inline script dependencies (
# /// script) for standalone servers - Launcher scripts handle gcloud auth and environment setup
- Full UV path required:
/Users/mark/.local/bin/uv - UV syntax:
uv run script.pynotuv run python script.py
Common Workflows
Adding a New MCP Tool
- Standalone Server (Recommended): Create script with inline dependencies
# /// script # dependencies = ["fastmcp>=0.1.0"] # /// -
Main Server Integration: Add to
backend/mcp_tools.py -
Registered Server: Add to
backend/tools/mcp_servers.py - External Service: Use
external_mcpwith runtime config
See Complete Guide - Adding New MCP Tools
Working Configuration (Tested ✅)
{
"mcpServers": {
"aitana": {
"command": "/Users/mark/dev/aitana-labs/frontend/backend/mcp_server_claude_desktop.sh"
},
"aitana_demo": {
"command": "/Users/mark/.local/bin/uv",
"args": ["run", "/Users/mark/dev/aitana-labs/frontend/backend/tools/mcp_tools/demo_server.py"]
}
}
}
Testing MCP Integration
- Test Page: http://localhost:1956/test
- Direct API:
/direct/tools/mcp/{server_id}/list - Protocol Test:
curl -X POST http://localhost:1956/mcp
Need Help?
- Setup Issues: Check Troubleshooting
- Adding Tools: See How to Add Tools
- API Details: Review Backend API Guide