MCP Server Hub / Gateway
by bsmi021
This project provides a central gateway to manage multiple MCP servers and expose hub-native tools, preventing the need to configure and run duplicate server processes for each LLM client. It supports dynamic configuration reloading, allowing managed servers and hub tools/services to be updated without restarting the main gateway server.
Last updated: N/A
What is MCP Server Hub / Gateway?
The MCP Server Hub/Gateway is a central point for managing multiple MCP servers and hub-native tools. It acts as a gateway, allowing LLM clients to access all managed servers and tools through a single interface, simplifying configuration and reducing resource usage.
How to use MCP Server Hub / Gateway?
- Install Node.js and npm. 2. Clone the repository and install dependencies using
npm install
. 3. Build the project usingnpm run build
. 4. Configure themcp_hub_config.json
file to define managed MCP servers and hub tools. 5. Start the server usingnpm start
. 6. Configure your LLM client to connect to thegateway-client
endpoint.
Key features of MCP Server Hub / Gateway
Dynamic configuration reloading
Manages multiple MCP servers
Exposes hub-native tools
WebSocket interface for LLM clients
Namespaced tool names (serverId__toolName, hub__toolName)
Use cases of MCP Server Hub / Gateway
Simplifying MCP server management for LLM applications
Centralizing access to multiple tools and services
Dynamically updating server and tool configurations without restarts
Providing a single point of entry for LLM clients to access various MCP servers
FAQ from MCP Server Hub / Gateway
How do I add a new MCP server?
How do I add a new MCP server?
Add a new entry to the mcpServers
section of the mcp_hub_config.json
file, specifying the command, arguments, and other process configuration options.
How do I add a new hub tool?
How do I add a new hub tool?
Add a new entry to the hubTools
section of the mcp_hub_config.json
file, specifying the module path, handler export, and other tool configuration options.
How do I update the configuration without restarting the server?
How do I update the configuration without restarting the server?
Simply modify the dist/mcp_hub_config.json
file while the server is running. The server will automatically detect the changes and reload the configuration.
Why is my LLM client not seeing the updated tool list?
Why is my LLM client not seeing the updated tool list?
The gateway-client
polls the Gateway Server for tool list updates periodically (default 5 minutes). You can configure the polling interval using the CLIENT_TOOL_REFRESH_INTERVAL_MS
environment variable for the client process. Restarting the MCP client process will also refresh the tool list.
What do the server ID prefixes in the logs mean?
What do the server ID prefixes in the logs mean?
Errors logged with a specific server ID prefix (e.g., [serverId/ERR]
) indicate problems within that underlying managed server, not the Gateway itself. Troubleshoot that server directly.