M

MCP中心

@warpdev/mcp-hub-mcp
0 Stars 110 次浏览 warpdev 更新于 2026-08-23

一个连接并管理其他MCP(模型上下文协议)服务器的中心服务器。

MCP 服务配置

复制以下 JSON 到 OPClaw 或其他 MCP 客户端的配置文件中即可使用

{
  "mcpServers": {
    "filesystem": {
      "args": [
        "-y",
        "@modelcontextprotocol/server-filesystem",
        "/Users/username/Desktop",
        "/Users/username/Downloads"
      ],
      "command": "npx"
    },
    "other-server": {
      "args": [
        "path/to/other-mcp-server.js"
      ],
      "command": "node"
    },
    "other-tools": {
      "args": [
        "-y",
        "mcp-hub-mcp",
        "--config-path",
        "/Users/username/mcp.json"
      ],
      "command": "npx"
    }
  }
}

该服务需要配置环境变量:MCP_CONFIG_PATH

服务介绍

MCP-Hub-MCP 服务器

一个连接和管理其他 MCP(模型上下文协议)服务器的中心服务器。

概述

该项目构建了一个 MCP 中心服务器,可以连接到其他 MCP 服务器,列出它们的工具,并执行这些工具。
它特别适用于绕过 Cursor 的 40 个工具的 MCP 限制。
即使在 Cursor 之外,它也有助于通过隐藏不常用的工具来减少 AI 错误。

主要功能

  • 通过配置文件自动连接到其他 MCP 服务器
  • 列出已连接服务器上的可用工具
  • 调用已连接服务器上的工具并返回结果

配置

将以下内容添加到您的 mcp.json 文件中:

使用 npx

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

系统提示(或 Cursor 规则)

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

这确保了 AI 助手在尝试使用工具之前始终会检查可用的工具。

安装与运行

要求

  • Node.js 18.0.0 或更高版本
  • npm、yarn 或 pnpm

安装

# Clone repository
git clone <repository-url>
cd mcp-hub-mcp

# Install dependencies
npm install
# or
yarn install
# or
pnpm install

构建

npm run build
# or
yarn build
# or
pnpm build

运行

npm start
# or
yarn start
# or
pnpm start

开发模式

npm run dev
# or
yarn dev
# or
pnpm dev

配置文件

MCP-Hub-MCP 服务器使用 Claude Desktop 格式的配置文件来自动连接到其他 MCP 服务器。
您可以按以下方式指定配置文件:

  1. 环境变量:设置 MCP_CONFIG_PATH 环境变量为配置文件路径
  2. 命令行参数:使用 --config-path 选项指定配置文件路径
  3. 默认路径:使用当前目录中的 mcp-config.json 文件

配置文件格式:

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

使用

MCP-Hub-MCP 服务器提供以下工具:

1. list-all-tools

从所有已连接服务器返回工具列表。

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

2. call-tool

在特定服务器上调用工具。

  • serverName: 要调用工具的 MCP 服务器名称
  • toolName: 要调用的工具名称
  • toolArgs: 传递给工具的参数
{
  "name": "call-tool",
  "arguments": {
    "serverName": "filesystem",
    "toolName": "readFile",
    "toolArgs": {
      "path": "/Users/username/Desktop/example.txt"
    }
  }
}

提交消息约定

此项目遵循 Conventional Commits 进行自动版本控制和 CHANGELOG 生成。

格式:<type>(<scope>): <description>

示例:

  • feat: add new hub connection feature
  • fix: resolve issue with server timeout
  • docs: update API documentation
  • chore: update dependencies

类型:

  • feat: 新功能 (MINOR 版本升级)
  • fix: Bug 修复 (PATCH 版本升级)
  • docs: 仅文档更改
  • style: 不影响代码意义的更改
  • refactor: 既不是修复 bug 也不是添加功能的代码更改
  • perf: 提高性能的代码更改
  • test: 添加缺失的测试或更正现有测试
  • chore: 对构建过程或辅助工具的更改

破坏性变更:
在提交注脚中添加 BREAKING CHANGE: 以触发 MAJOR 版本升级。

技术栈

  • Node.js
  • TypeScript
  • @modelcontextprotocol/sdk (版本: ^1.9.0)
  • zod (版本: ^3.22.4)

许可证

请注意,原始 Markdown 内容中的 #0#9 是占位符,实际内容应根据具体情况填写。

MIT

看起来您提供的内容仅为“MIT”,这通常指的是麻省理工学院(Massachusetts Institute of Technology)或者是一种开源许可协议的简称。如果"MIT"是在特定上下文中使用的,请提供更多的信息或具体的markdown文本以便于准确翻译。对于仅有的"MIT"这个词,它本身不需要翻译,因为它是一个专有名词。如果有更详细的文档或其他需要翻译的内容,请补充提供。

相关 MCP 服务