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.
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
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
The MCP-Hub-MCP server requires a configuration file to connect to other MCP servers. You can specify this file in several ways:
--config-path
command line argumentMCP_CONFIG_PATH
environment variablemcp-config.json
file in the current directoryCreate a configuration file with the following structure:
{
"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"
]
},
"database": {
"command": "node",
"args": ["path/to/database-mcp-server.js"]
}
}
}
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"
]
}
}
}
The MCP-Hub-MCP server provides two main tools:
Use the list-all-tools
command to get a list of all tools available across connected servers:
{
"name": "list-all-tools",
"arguments": {}
}
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"
}
}
}
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.
npm start
For development with auto-reloading:
npm run dev
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 > 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"
]
}
}
}
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 explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.