Get the FREE Ultimate OpenClaw Setup Guide →

mcp-hub

A centralized manager for Model Context Protocol (MCP) servers with dynamic server management and monitoring

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio ravitemer-mcp-hub npx -y mcp-hub --port 37373 --config path/to/config.json

How to use

MCP Hub acts as a central coordinator that lets you manage multiple MCP servers and expose a single client endpoint for MCP capabilities. It provides a REST API under /api for server management and a unified MCP endpoint at /mcp for MCP clients to access tools, resources, prompts, and templates across all connected servers. Clients such as Claude Desktop or other MCP clients can connect to localhost:37373/mcp and discover capabilities from every registered MCP server, with real-time updates and automatic namespacing to avoid conflicts. The hub supports OAuth with PKCE, header-based authentication, and dynamic server management including starting, stopping, and auto-reconnection when servers change. It also offers a VS Code-friendly configuration format and JSON5 support for comment-friendly config files, enabling you to define servers with environment variable substitutions and command executions across all fields.

How to install

Prerequisites:

  • Node.js (recommended: latest LTS) and npm
  • Access to install global npm packages

Install MCP Hub globally:

npm install -g mcp-hub

Basic usage to start the hub:

mcp-hub --port 3000 --config /path/to/config.json

If you prefer to use a local config, you can also run with a merged set of config files:

mcp-hub --port 3000 --config ~/.config/mcphub/global.json --config ./.mcphub/project.json

Configuration files can be authored using the MCP Hub JSON format (with ${} style substitutions). See the README for examples of mcpServers configuration and VS Code compatibility. Ensure your config enables the servers you want to manage and uses the universal placeholder syntax for environment variables and command execution.

Additional notes

Tips and notes:

  • MCP Hub routes capabilities from all managed servers to a single /mcp endpoint. Use /api for server management and status events via SSE.
  • Use ${env:VAR} or ${VAR} in config values to inject environment variables, and leverage ${cmd: ...} for command execution within config fields.
  • For client configuration, you can use a simplified endpoint example like {"mcpServers": {"Hub": {"url": "http://localhost:37373/mcp"}}} to point clients at the hub.
  • If you rely on VS Code-style configuration, MCP Hub supports both mcpServers and servers keys and can consume JSON5 with trailing commas or comments.
  • For authentication, you can enable OAuth 2.0 with PKCE and header-based tokens; consider setting up API keys in headers for secure access.
  • If you encounter issues starting the hub, check that the port is available, the config file path is correct, and that the environment variables referenced in the config are exported in your shell.
  • The hub provides real-time capability updates and server status through SSE; monitor /api/events for events and state changes.

Related MCP Servers

Sponsor this space

Reach thousands of developers