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
Provider
Uhyeon Park
Release date
Apr 12, 2025
Language
TypeScript
Package
Stats
478 downloads
16 stars

The MCP-Hub-MCP server connects to and manages other MCP (Model Context Protocol) servers. It helps bypass Cursor's 40-tool MCP limit and reduces AI mistakes by hiding infrequently used tools by providing a central hub that can access tools from multiple MCP servers.

Installation

Requirements

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

Installing via npm

The easiest way to use the MCP-Hub-MCP server is through npx:

npx -y mcp-hub-mcp --config-path /path/to/your/mcp.json

Manual Installation

If you prefer to install it locally:

# Install from npm
npm install mcp-hub-mcp

# Or, clone repository and install dependencies
git clone https://github.com/path-to/mcp-hub-mcp
cd mcp-hub-mcp
npm install

After installation, build the project:

npm run build

Configuration

The MCP-Hub-MCP server requires a configuration file to connect to other MCP servers. You can specify this file in several ways:

  1. Using the --config-path command line argument
  2. Setting the MCP_CONFIG_PATH environment variable
  3. Creating an mcp-config.json file in the current directory

Configuration Format

Create a configuration file with the following structure:

{
  "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"
      ]
    },
    "database": {
      "command": "node",
      "args": ["path/to/database-mcp-server.js"]
    }
  }
}

Integration with Cursor

To integrate with Cursor, add this to your mcp.json:

{
  "mcpServers": {
    "other-tools": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-hub-mcp",
        "--config-path",
        "/Users/username/mcp.json"
      ]
    }
  }
}

Usage

Available Tools

The MCP-Hub-MCP server provides two main tools:

Listing All Tools

Use the list-all-tools command to get a list of all tools available across connected servers:

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

Calling Tools on Connected Servers

Use the call-tool command to execute a tool on a specific server:

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

Recommended System Prompt

For best results, add this to your system prompt or Cursor rules:

Before processing a user's request, you must use the "list_all_tools" command to identify which tools are available.

This ensures the AI assistant will check available tools before attempting to use them.

Running the Server

Standard Run

npm start

Development Mode

For development with auto-reloading:

npm run dev

How to add this MCP server to 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 > MCP and click "Add new global MCP server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "cursor-rules-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "cursor-rules-mcp"
            ]
        }
    }
}

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 explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.

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