Metis is an advanced AI agent platform with an intelligent MCP (Model Context Protocol) router that dynamically manages up to 1,000+ MCP servers. The router uses an LRU cache system to maintain only the most relevant servers active at any time, preventing context overwhelm while providing access to a vast ecosystem of tools and services. We wanted to create this so you can add additional features while not having to deal with context overload from having over 40 tools enabled! We also provide a modular web based MCP client that anyone can modify! Our goal for this is to help others build cool applications using MCPs.
Add the MCP servers you want to server/mcp-registry.json. You can add up to 1,000+ servers:
Edit server/src/add-new-mcp.ts and modify MAX_ACTIVE_SERVERS to set how many servers stay active simultaneously:
NOTE: All active MCP servers are in server/config.json, you can manually remove/add servers to the active queue of MCP servers here
Server folder (server/.env):
Backend folder (client/backend/.env):
🚨 CRITICAL: All authentication happens during indexing. Any time you:
- Add new servers to mcp-registry.json
- Want to re-authenticate existing servers
- Change server configurations
You MUST rerun the setup script:
This will:
- Authenticate with all configured servers
- Store credentials in ~/.mcp-auth
- Index and embed all servers for AI-powered selection
- Generate the router configuration
Open http://localhost:3000 and start chatting!
- Automatic Server Selection: The AI automatically selects the best MCP server/tools for your query
- Manual Server Specification: You can also specify which server to use
- Dynamic Loading: The router loads/unloads servers as needed using LRU cache
- Real-time Tool Discovery: Available tools update dynamically
- Registry: Up to 1,000+ servers in mcp-registry.json
- Active Cache: Only MAX_ACTIVE_SERVERS are loaded simultaneously
- Dynamic Loading: Servers are loaded/unloaded based on usage (Least Recently Used)
- Current State: config.json shows currently active servers in the cache
- User asks a question
- AI analyzes the query using embeddings
- Router selects the best MCP server(s) and tools
- If server isn't in cache, it's loaded (LRU eviction if cache full)
- Tools are executed and results returned
- Storage: Credentials stored in ~/.mcp-auth
- Timing: Authentication happens during indexing (./setup.sh)
- Re-auth: Run ./setup.sh to re-authenticate or add new servers
- Cleanup: Remove credentials with rm -rf ~/.mcp-auth
- Purpose: Manages 1000+ MCP servers with intelligent caching and AI-powered selection
- Tech Stack: Node.js, TypeScript, OpenAI API
- Key Features:
- LRU cache system with configurable MAX_ACTIVE_SERVERS
- AI-powered server selection using semantic embeddings
- Dynamic server loading/unloading
- Centralized authentication management
- Real-time server status tracking
- Purpose: AI agent orchestration and API endpoints
- Tech Stack: FastAPI, Python, OpenAI Agents SDK
- Key Features:
- Session management with streaming responses
- Integration with intelligent MCP router
- Tool execution and response handling
- Real-time communication via SSE
- Purpose: User interface for the AI agent playground
- Tech Stack: Next.js, React, TypeScript
- Key Features:
- Real-time chat interface with tool visualization
- Server selection transparency
- Streaming response display
- Modern, responsive design
- Auto Refresh Tools
- **Modular, modify how you see fit
Edit server/src/add-new-mcp.ts:
Required in both /server/.env and /client/backend/.env:
- Node.js 18+
- Python 3.8+
- OpenAI API Key (required for server selection and embeddings)
If you prefer to run services individually:
Server:
Backend:
Frontend:
- 1000+ Server Support: Manage massive MCP server ecosystems
- LRU Caching: Smart memory management with configurable cache size
- AI-Powered Selection: Automatic server/tool selection using embeddings
- Dynamic Loading: Servers load/unload based on demand
- Authentication Management: Centralized credential storage and handling
- Automatic Tool Discovery: AI selects optimal servers and tools for any query
- Real-time Streaming: Live response generation with tool call visualization
- Session Management: Persistent conversations with context preservation
- Flexible Interaction: Use any server or let AI choose automatically
- Context Optimization: Never overwhelm the AI with too many servers
- Graceful Fallbacks: Robust error handling and recovery
- Hot Reloading: Add servers without system restart
- Monitoring: Real-time server status and performance tracking
- Add to Registry: Edit server/mcp-registry.json
- Reindex & Authenticate: Run ./setup.sh (CRITICAL for auth!)
- Automatic Integration: Router will discover and integrate new servers
Check server/config.json to see which servers are currently loaded in the cache.
- Authentication Failures: Run ./setup.sh after adding new servers
- Server Selection Problems: Ensure OpenAI API key is set in both .env files
- Cache Overflow: Reduce MAX_ACTIVE_SERVERS in server/src/add-new-mcp.ts
- Port Conflicts: Ensure ports 3000, 8000, and 9999 are available
- Router Logs: Check server terminal for server loading/unloading
- Authentication Logs: Watch for auth failures during ./setup.sh
- AI Selection: Backend logs show which servers/tools are selected
- Cache Status: Monitor config.json for active server changes
This project is licensed under the MIT License.
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
For more information or support, please refer to the individual component README files or open an issue.