MCP Hub
Mantra v0.7.0 introduces the powerful MCP Hub, the central nervous system for your AI programming tools.
What is MCP Hub?
MCP Hub is a full implementation of the MCP (Model Context Protocol) open standard initiated by Anthropic. It aggregates multiple MCP services into a compliant Streamable HTTP server, acting as both a "traffic relay" and a "control panel":
- Unified Entry Point: Aggregates multiple MCP services (supporting all standard protocols like stdio, SSE).
- Transparent Takeover: MCP Hub can take over MCP configurations from tools like Claude Code and Cursor, allowing you to manage permissions for all AI tools in one place.
- Security Control: Unified management of service associations and tool enablement/disablement via a graphical interface.
Key Features
- Service Management: Add, edit, and toggle MCP services (supporting all standard MCP protocols).
- Environment Variable Management: Configure global or project-specific environment variables for MCP services, with sensitive info masking.
- OAuth Credential Management: Securely store authentication tokens required for remote MCP services (e.g., Google Drive).
- Status Monitoring: Real-time view of hub status, connected clients, and active services.
Configuration Takeover
The core workflow of MCP Hub is takeover: one-click import of MCP configurations from your existing AI tools, with no manual reconfiguration needed.
Supported Tools
| Tool | User-level Config | Project-level Config |
|---|---|---|
| Claude Code | ✅ | ✅ (local scope) |
| Cursor | ✅ | ✅ |
| Gemini CLI | ✅ | ✅ |
| Codex | ✅ | ✅ |
Smart Merge Engine
During takeover, MCP Hub uses a three-tier classification strategy to handle configuration differences:
- New: Services that don't exist in the Hub, imported directly
- Updated: Existing services with configuration changes, prompts for update
- Conflict: Key fields are inconsistent, provides diff comparison and manual decision
Original configurations are automatically backed up before each takeover operation, supporting atomic recovery.
Project-Level Management
v0.8.2 added project-level MCP management capabilities:
- Sidebar Management Panel: Manage MCP service associations directly from the project context menu
- Scoped Config Import: Auto-scan and filter configurations based on project scope
- Enhanced Detection: Automatically identify new services, filter out existing ones
Tool Permission Management (Tool Policy)
Mantra implements industry-leading project-level granular tool permission control.
Core Capabilities
- Project-level Policies: Set different tool access permissions for different projects. For example, allow AI to modify files in "Project A" but only read them in "Project B".
- Precise Permission Management: Set permissions for individual tools (e.g.,
read_file,shell_execute):- Enable: Allow AI to use the tool.
- Disable: Prohibit AI from using the tool; the Hub will intercept the call.
- Dynamic Takeover: By taking over configurations from other AI tools, Mantra can enforce these security policies even when you are using native Claude Code.
- Strict Mode: Filter services based on project context, ensuring only MCP services relevant to the current project are exposed.
MCP Roots Protocol
MCP Hub implements the MCP Roots protocol, supporting project-level configuration awareness:
- AI tools (Claude Code, Gemini CLI, Codex, Cursor) inform the current working directory via
roots/listrequests - MCP Hub uses Longest Prefix Match (LPM) algorithm to automatically route to the corresponding MCP services based on project context
- No manual project switching needed — MCP Hub automatically detects which project you're working in
Built-in MCP Inspector
To help developers debug MCP services, Mantra includes a professional built-in Inspector:
- Real-time Logs: View JSON-RPC communication between AI models and MCP services.
- Manual Trigger: Manually invoke tools in the Inspector to verify that services return the correct context.
- Troubleshooting: Quickly identify connection timeouts, permission errors, or data format mismatches.
Backup & Restore
MCP Hub provides comprehensive backup and restore mechanisms to safeguard your configurations:
- Atomic Operations: Both takeover and restore operations are atomic, with automatic rollback on failure
- Version Retention: Retains the last 5 backup versions
- Integrity Verification: Automatic backup file integrity verification before restore
- Auto Cleanup: Expired backups are automatically cleaned up
System Tray Integration
To ensure the MCP Hub provides continuous service in the background, Mantra deeply integrates with the system tray:
- Background Execution: Mantra keeps running in the background when the main window is closed, maintaining MCP service availability.
- Quick Access: Open the Hub, Inspector, or quit the app directly from the tray menu.
- Status Notifications: Real-time notifications via tray icon changes for hub exceptions or interception events.
Streamable HTTP Compliance
MCP Hub complies with the MCP Streamable HTTP specification (2025-03-26 version):
- Unified Endpoint:
/mcpsupports POST, GET, and DELETE operations - Session Management: Managed via the
MCP-Session-Idheader - Origin Validation: Prevents cross-site request forgery
- Backward Compatibility: Also supports legacy
/sseand/messageendpoints
Next Steps
- Skills Hub - Learn about unified Skills management (symmetric design with MCP Hub)
- Project Management - Learn how to associate MCP services with projects
- Keyboard Shortcuts - Learn how to quickly toggle debug modes
