Hub MCP server

Centralizes multiple MCP servers into a unified hub, enabling seamless tool discovery and routing across specialized servers for complex workflows without managing individual connections.
Back to servers
Setup instructions
Provider
Uhyeon Park
Release date
Apr 12, 2025
Language
TypeScript
Package
Stats
1.3K downloads
32 stars

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.

Installation

Requirements

  • Node.js 18.0.0 or higher
  • npm, yarn, or pnpm

Using NPX (Recommended)

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

Manual Installation

# Install dependencies
npm install mcp-hub-mcp

# Or globally
npm install -g mcp-hub-mcp

Configuration

The MCP-Hub server uses a configuration file to manage connections to other MCP servers. You can specify this file in three ways:

  1. Command line argument: --config-path /path/to/config.json
  2. Environment variable: MCP_CONFIG_PATH=/path/to/config.json
  3. Default location: mcp-config.json in the current directory

Configuration File Format

{
  "mcpServers": {
    "serverName1": {
      "command": "command",
      "args": ["arg1", "arg2"],
      "env": { "ENV_VAR1": "value1" }
    },
    "serverName2": {
      "command": "anotherCommand",
      "args": ["arg1", "arg2"]
    }
  }
}

Example Configuration

{
  "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"]
    }
  }
}

Integrating with MCP Client

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"
      ]
    }
  }
}

Usage

The MCP-Hub server provides several tools for managing and interacting with connected MCP servers:

Listing All Tools

Lists all tools available from connected servers:

{
  "name": "list-all-tools",
  "arguments": {}
}

Calling a Tool

Calls a specific tool on a connected server:

{
  "name": "call-tool",
  "arguments": {
    "serverName": "filesystem",
    "toolName": "readFile",
    "toolArgs": {
      "path": "/Users/username/Desktop/example.txt"
    }
  }
}

Finding Tools

Searches for tools matching a regex pattern across all connected servers:

{
  "name": "find-tools",
  "arguments": {
    "pattern": "file",
    "searchIn": "both",
    "caseSensitive": false
  }
}

Search Options

  • 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)

Example Output

{
  "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"]
      }
    }
  ]
}

Running the Server

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

How to install this MCP server

For Claude Code

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.

For Cursor

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.

Adding an MCP server to Cursor globally

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"
            ]
        }
    }
}

Adding an MCP server to a project

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.

How to use the MCP server

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.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.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

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later