| Crates.io | mcp-hub |
| lib.rs | mcp-hub |
| version | 0.1.0 |
| created_at | 2025-06-30 14:14:29.013268+00 |
| updated_at | 2025-06-30 14:14:29.013268+00 |
| description | Fast hub for MCP tools |
| homepage | |
| repository | |
| max_upload_size | |
| id | 1731883 |
| size | 257,959 |
An aggregating MCP (Model Context Protocol) server that runs multiple child MCP servers as subprocesses and provides a unified interface with automatic process supervision, hot reload, and fault tolerance.
MCP Hub is an aggregating MCP (Model Context Protocol) server that runs multiple child MCP servers as subprocesses and combines their tools into a unified interface for AI editors like Zed.
🚀 Process Supervision - Automatic restart of failed processes with exponential backoff
🔌 Tool Aggregation - Combines tools from multiple MCP servers into one interface
🛡️ Circuit Breaker - Fault tolerance with automatic recovery (3 failures → 30s cooldown)
🏷️ Name Deduplication - Handles tool name conflicts with configurable prefixes
🔧 Tool Filtering - Whitelist/blacklist tools per server
📝 Description Enhancement - Add prefixes/suffixes to tool descriptions
🔄 Hot Reload - Reload configuration without restarting (planned)
⚡ Graceful Shutdown - Clean process termination on SIGINT/SIGTERM
# Clone the repository
git clone https://github.com/your-org/mcp-hub
cd mcp-hub
# Build the project
cargo build --release
# The binary will be available at target/release/mcp-hub
# config.toml
[[server]]
name = "filesystem"
cmd = "python"
args = ["-m", "mcp_filesystem"]
prefix = "fs_"
[[server]]
name = "search"
cmd = "exa_mcp"
prefix = "search_"
[server.env]
EXA_API_KEY = "${EXA_API_KEY}"
./target/release/mcp-hub config.toml
MCP Hub uses TOML configuration files. Each [[server]] section defines one child MCP server:
[[server]]
name = "my_server" # Unique identifier
cmd = "python" # Command to run
args = ["-m", "my_mcp"] # Command arguments
[[server]]
name = "api_server"
cmd = "my-mcp-server"
[server.env]
API_KEY = "${MY_API_KEY}" # Expands from environment
TIMEOUT = "30" # Literal value
USER_HOME = "${HOME:-/tmp}" # With fallback
[[server]]
name = "filtered_server"
cmd = "dangerous-mcp"
# Include only these tools (takes precedence over blacklist)
whitelist = ["safe_tool1", "safe_tool2"]
# OR exclude these tools
blacklist = ["dangerous_tool", "risky_operation"]
[[server]]
name = "enhanced_server"
cmd = "my-mcp"
prefix = "enhanced_" # Prefix for conflicting tool names
description_prefix = "🔧 Enhanced: " # Prefix for all descriptions
description_suffix = " (via Enhanced API)" # Suffix for all descriptions
See example.toml for a comprehensive configuration with 10 different server types.
Zed Editor ←→ MCP Hub ←→ [exa_mcp, filesystem_mcp, git_mcp, ...]
│
├── Hub Actor (coordinator)
├── Process Supervisors (one per child server)
├── Circuit Breakers (fault protection)
└── Configuration Hot Reload
# Debug build
cargo build
# Release build (optimized)
cargo build --release
# With native CPU optimizations
RUSTFLAGS="-C target-cpu=native" cargo build --release
# All tests
cargo test
# Unit tests only
cargo test --lib
# Integration tests only
cargo test --test integration
# With clippy linting
cargo clippy
Enable tokio console for runtime inspection:
TOKIO_CONSOLE=1 ./target/debug/mcp-hub config.toml
Then connect with:
tokio-console
Control log levels with RUST_LOG:
# Default: info for mcp-hub, warn for rmcp
RUST_LOG=debug ./target/release/mcp-hub config.toml
# Detailed logging
RUST_LOG=mcp_hub=trace,rmcp=debug ./target/release/mcp-hub config.toml
Add MCP Hub to your Zed settings:
{
"language_models": {
"anthropic": {
"mcp_servers": {
"mcp-hub": {
"command": "/path/to/mcp-hub",
"args": ["/path/to/your/config.toml"]
}
}
}
}
}
Process fails to start:
Tool name conflicts:
prefix in server configuration to disambiguateCircuit breaker activated:
tests/ directory for usage patternsgit checkout -b my-featurecargo testcargo clippygit commit -am 'Add my feature'git push origin my-featurecargo fmtcargo clippyThis project is licensed under the MIT License - see the LICENSE file for details.