MCP-Hub-MCP Server is a central hub that connects to and manages multiple Model Context Protocol (MCP) servers through a single interface. It helps prevent context pollution and improves AI performance by allowing you to connect only the tools you need when you need them.
The easiest way to install and use the MCP-Hub server is with npx:
npx -y mcp-hub-mcp --config-path ~/path/to/your/config.json
# Install dependencies
npm install mcp-hub-mcp
# Or globally
npm install -g mcp-hub-mcp
The MCP-Hub server uses a configuration file to manage connections to other MCP servers. You can specify this file in three ways:
--config-path /path/to/config.json
MCP_CONFIG_PATH=/path/to/config.json
mcp-config.json
in the current directory{
"mcpServers": {
"serverName1": {
"command": "command",
"args": ["arg1", "arg2"],
"env": { "ENV_VAR1": "value1" }
},
"serverName2": {
"command": "anotherCommand",
"args": ["arg1", "arg2"]
}
}
}
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-filesystem",
"/Users/username/Desktop",
"/Users/username/Downloads"
]
},
"other-server": {
"command": "node",
"args": ["path/to/other-mcp-server.js"]
}
}
}
To add the MCP-Hub server to your MCP client configuration:
{
"mcpServers": {
"other-tools": {
"command": "npx",
"args": [
"-y",
"mcp-hub-mcp",
"--config-path",
"/Users/username/mcp.json"
]
}
}
}
The MCP-Hub server provides several tools for managing and interacting with connected MCP servers:
Lists all tools available from connected servers:
{
"name": "list-all-tools",
"arguments": {}
}
Calls a specific tool on a connected server:
{
"name": "call-tool",
"arguments": {
"serverName": "filesystem",
"toolName": "readFile",
"toolArgs": {
"path": "/Users/username/Desktop/example.txt"
}
}
}
Searches for tools matching a regex pattern across all connected servers:
{
"name": "find-tools",
"arguments": {
"pattern": "file",
"searchIn": "both",
"caseSensitive": false
}
}
pattern
: Regex pattern to match (e.g., "^read"
for tools starting with "read")searchIn
: Where to search - "name", "description", or "both" (default)caseSensitive
: Whether search is case-sensitive (default: false){
"filesystem": [
{
"name": "readFile",
"description": "Read the contents of a file",
"inputSchema": {
"type": "object",
"properties": {
"path": {
"type": "string",
"description": "Path to the file to read"
}
},
"required": ["path"]
}
},
{
"name": "writeFile",
"description": "Write content to a file",
"inputSchema": {
"type": "object",
"properties": {
"path": {
"type": "string",
"description": "Path to the file to write"
},
"content": {
"type": "string",
"description": "Content to write to the file"
}
},
"required": ["path", "content"]
}
}
]
}
After configuration, you can run the server with:
# Using npx
npx mcp-hub-mcp --config-path /path/to/config.json
# Or if installed globally
mcp-hub-mcp --config-path /path/to/config.json
To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "mcp-hub" '{"command":"npx","args":["-y","mcp-hub-mcp","--config-path","~/mcp-hub.json"]}'
See the official Claude Code MCP documentation for more details.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"mcp-hub": {
"command": "npx",
"args": [
"-y",
"mcp-hub-mcp",
"--config-path",
"~/mcp-hub.json"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration file:
{
"mcpServers": {
"mcp-hub": {
"command": "npx",
"args": [
"-y",
"mcp-hub-mcp",
"--config-path",
"~/mcp-hub.json"
]
}
}
}
3. Restart Claude Desktop for the changes to take effect