MCP Proxy Hub
Aggregates multiple MCP resource servers into a single interface using a JSON configuration file.
MCP Proxy Hub
An MCP proxy server that aggregates and serves multiple MCP resource servers through a single interface. This server acts as a central hub that can:
- Connect to and manage multiple MCP resource servers
- Expose their combined capabilities through a unified interface
- Handle routing of requests to appropriate backend servers
- Aggregate responses from multiple sources
Features
Resource Management
- Discover and connect to multiple MCP resource servers
- Aggregate resources from all connected servers
- Maintain consistent URI schemes across servers
- Handle resource routing and resolution
Tool Aggregation
- Expose tools from all connected servers with server name prefixes
- Apply tool filtering based on configuration (exposedTools/hiddenTools)
- Support tool name remapping via configuration
- Route tool calls to appropriate backend servers
Custom Tool Support
-
Define compound tools that combine functionality from multiple servers
-
Execute subtools using server and tool name specifications
-
Provide detailed documentation through tool descriptions
-
Specify execution with a standardized format:
{ "server": "server_name", "tool": "tool_name", "args": { // Tool-specific arguments } }
Environment Variable Support
- Automatically expand environment variables in tool arguments
- Automatically replace sensitive values with variable references in responses
- Configure which variables should be expanded/unexpanded via configuration
- Support for both global (all servers) and server-specific environment variables
- Server-specific variables take precedence over global variables with the same name
- Each variable can be independently configured for expansion and unexpansion
- Environment variables are only expanded when using the
${VARIABLE_NAME}syntax (e.g.,${API_KEY}). The$VARIABLE_NAMEsyntax is not supported. - Secure handling of sensitive information like API keys
Prompt Handling
- Aggregate prompts from all connected servers
- Route prompt requests to appropriate backends
- Handle multi-server prompt responses
Configuration
The server requires a JSON configuration file that specifies the MCP servers to connect to. Copy the example config(config.example.json) and modify it for your needs:
cp config.example.json config.json
Configuration Options
MCP Server Configuration
-
Stdio-type Server:
command: Command to execute (required)args: Command line arguments (optional)env: Environment variables (optional)exposedTools: Array of tools to expose (optional)hiddenTools: Array of tools to hide (optional)envVars: Environment variable configuration for tool arguments and responses (optional)enable: Whether to enable the server (optional, default: true)
-
SSE-type Server:
type: "sse" (required)url: URL of the SSE server (required)headers: Object of HTTP headers to send with the SSE connection (optional)exposedTools: Array of tools to expose (optional)hiddenTools: Array of tools to hide (optional)envVars: Environment variable configuration for tool arguments and responses (optional)enable: Whether to enable the server (optional, default: true)
-
Streamable HTTP-type Server:
type: "streamable-http" (required)url: URL of the Streamable HTTP server (required)headers: Object of HTTP headers to send with requests (optional)exposedTools: Array of tools to expose (optional)hiddenTools: Array of tools to hide (optional)envVars: Environment variable configuration for tool arguments and responses (optional)enable: Whether to enable the server (optional, default: true)
Tool Filtering Configuration
-
exposedTools:
- Only exposes specified tools
- Array containing strings (original tool names) or {original, exposed} objects (for renaming)
-
hiddenTools:
- Hides specified tools
- Array of tool name strings to hide
Environment Variables Configuration
-
Server-specific envVars:
-
Array of environment variable configurations for a specific server
-
Each configuration has the following properties:
name: Name of the environment variablevalue: Value of the environment variableexpand: Whether to expand this variable in tool arguments (optional, defaults to false)unexpand: Whether to unexpand this variable in tool responses (optional, defaults to false)
-
Example:
"envVars": [ { "name": "API_KEY", "value": "my-api-key", "expand": true, "unexpand": true }, { "name": "USER_ID", "value": "user123", "expand": true, "unexpand": false } ]
-
-
Global envVars:
-
Array of environment variable configurations applied to all servers
-
Uses the same configuration format as server-specific envVars
-
Server-specific variables with the same name override global variables
-
Defined at the root level of the configuration file
-
Example:
"envVars": [ { "name": "GLOBAL_API_KEY", "value": "global-api-key", "expand": true, "unexpand": true }, { "name": "GLOBAL_ENV", "value": "production", "expand": true, "unexpand": false } ]
-
Server Transport Configuration
Configure how the proxy hub itself is served via the serverTransport section:
"serverTransport": {
"type": "streamable-http",
"port": 3006,
"host": "0.0.0.0",
"path": "/mcp",
"auth": {
"type": "bearer",
"token": "your-secret-token"
}
}
type: Transport type ("stdio", "sse", or "streamable-http")port: Port number for HTTP-based transports (default: 3006)host: Host to bind to (default: "0.0.0.0")path: URL path for Streamable HTTP endpoint (default: "/mcp")auth: Authentication configuration (optional)type: "bearer" (currently the only supported type)token: The bearer token required for authentication
Authentication can also be configured via the MCP_PROXY_AUTH_TOKEN environment variable.
Custom Tool Configuration
- tools:
- Object with custom tool names as keys
- Each tool has
descriptionandsubtools subtoolsis keyed by server name and contains each server's tool list
Environment Variables
MCP_PROXY_CONFIG_PATH: Path to the configuration fileMCP_PROXY_LOG_DIRECTORY_PATH: Path to the log directoryMCP_PROXY_LOG_LEVEL: Log level ("debug" or "info")MCP_PROXY_AUTH_TOKEN: Bearer token for authenticating incoming requests to the proxy serverMCP_PROXY_PATH: URL path for Streamable HTTP endpoint (default: "/mcp")KEEP_SERVER_OPEN: Whether to keep the server open after client disconnection in SSE mode (set to "1" to enable)PORT: Port for the SSE/Streamable HTTP server (default: 3006)HOST: Host to bind for the HTTP server (default: "0.0.0.0")
Development
Install dependencies:
npm install
Build the server:
npm run build
For development with auto-rebuild:
npm run watch
For development with continuous run:
# Stdio
npm run dev
# SSE
npm run dev:sse
# Streamable HTTP
npm run dev:http
CLI
The CLI provides two modes of operation for interacting with the MCP Proxy Hub.
Direct Execution Mode
You can execute commands directly from your terminal. This is useful for scripting and automation.
-
List available tools:
mcp-proxy-hub-cli list -
Call a tool:
mcp-proxy-hub-cli call <toolName> [args...]toolName: The name of the tool to call.args: Arguments for the tool inkey=valueformat.--output-dir <dir>or-o <dir>: Save the output to a directory.
Example:
mcp-proxy-hub-cli call my_tool param1=value1 -o output
Interactive Mode
If you run the CLI without any arguments, it will start in interactive mode. This provides a shell-like interface for running commands.
mcp-proxy-hub-cli
Once in interactive mode, you can use the following commands:
list: List available tools.call <toolName> [args...]: Call a tool with arguments.exit: Exit the interactive session.
Installation
To use with Claude Desktop, add the server config:
On MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json
On Windows: %APPDATA%/Claude/claude_desktop_config.json
{
"mcpServers": {
"mcp-proxy-hub": {
"command": "/path/to/mcp-proxy-hub/build/index.js",
"env": {
"MCP_PROXY_CONFIG_PATH": "/absolute/path/to/your/config.json",
"KEEP_SERVER_OPEN": "1"
}
}
}
}
KEEP_SERVER_OPEN will keep the SSE running even if a client disconnects. This is useful when multiple clients connect to the MCP proxy.
Debugging
Since MCP servers communicate over stdio, debugging can be challenging. We recommend using the MCP Inspector, which is available as a package script:
npm run inspector
The Inspector will provide a URL to access debugging tools in your browser.
Related Servers
Scout Monitoring MCP
sponsorPut performance and error data directly in the hands of your AI assistant.
Alpha Vantage MCP Server
sponsorAccess financial market data: realtime & historical stock, ETF, options, forex, crypto, commodities, fundamentals, technical indicators, & more
Juspay MCP Tools
Interact with Juspay APIs for payment processing and merchant dashboard management.
swarm.at
Settlement protocol that validates agent actions before execution. Guards destructive operations with hash-chained ledger receipts, trust tiers, and 31 workflow blueprints.
agentwallet-mcp
Server-side EVM wallet for Ai agents. Send transactions, manage tokens, and interact with smart contracts across multiple chains.
Unified MCP Client Library
A TypeScript library for integrating MCP with tools like LangChain and Zod, providing helpers for schema conversion and event streaming.
Stock Ticker MCP Server
A demo MCP server that provides rude responses to stock queries.
zig-mcp
MCP server for Zig that connects AI coding assistants to ZLS (Zig Language Server) via LSP — 16 tools for code intelligence, build, and test.
Web3 MCP
Interact with multiple blockchains including Solana, Ethereum, THORChain, XRP Ledger, TON, Cardano, and UTXO chains.
CGM MCP Server
A server for CodeFuse-CGM, a graph-integrated large language model designed for repository-level software engineering tasks.
XcodeBuildMCP
A Model Context Protocol (MCP) server and CLI that provides tools for agent use when working on iOS and macOS projects.
MAVAE - IMAGE TOOLBOX
A creative toolkit for AI agents to generate, edit, and manage images, models, and collections using the MAVAE API.