多AI编码代理MCP服务器管理器

统一管理多个AI编码代理的MCP服务器,支持一键同步到Claude Code、Codex、Cursor等多种代理。

  • by jtianling
  • TypeScript
  • 本地部署
  • 5 星标
  • 更新于
在 GitHub 查看 jtianling/mcps-manager

使用说明

mcpsmgr

用于多个AI编码代理的统一MCP(模型上下文协议)服务器管理器——定义一次MCP服务器,从一个地方将其同步到Claude Code、Codex、Cursor、Gemini CLI、OpenCode、Antigravity、OpenClaw和Hermes Agent。

中文文档

快速开始

# Install one or many MCP servers from a GitHub repo
npx mcpsmgr add jtianling/cross-agent-teams-mcp -a claude-code -y

# Or interactively pick which agent to deploy to
npx mcpsmgr add anthropics/some-mcp-server

就这样 mcpsmgr 获取回购 mcpsmgr.json manifest(或回退到README扫描),将服务器记录在您的中央存储库中 ~/.mcps-manager/servers/,并将正确的配置写入代理的本机文件(.claude.json, .codex/config.toml等等)。

需要将已安装的服务器部署到新项目中吗? cd 进入项目并运行 npx mcpsmgr deploy.

安装

npm install -g mcpsmgr     # or pnpm add -g / yarn global add

或者无需安装即可在任何地方运行:

npx mcpsmgr <command>

向项目添加服务器(add)

mcpsmgr add 是主要的切入点。它接受三种输入形状:

mcpsmgr add my-server                                  # already in central repo
mcpsmgr add owner/repo                                 # GitHub shorthand
mcpsmgr add https://github.com/owner/repo              # full GitHub URL
mcpsmgr add repo                                       # repo basename (bundle reverse-lookup)

解析器在存在匹配的中心条目或包时选择它,并仅在本地没有缓存任何内容时才返回到获取清单。这意味着重新运行 add owner/repo 首次安装后快速且离线安全。

有用的旗帜

-a, --agent <id>     Target a specific agent without prompting
-y                   Unattended: auto-select detected agents, overwrite existing,
                     fail-fast on missing required vars/env (implies --force)
-f, --force          Overwrite existing central entries without confirmation
--port <number>      Override manifest variables.port (manifest-driven flow)
--global             Write agent config to the agent's global config location
                     instead of the project (codex: ~/.codex/config.toml,
                     opencode: ~/.config/opencode/opencode.json,
                     kimi-code: ~/.kimi-code/mcp.json)
--var <name=value>   Provide manifest env var / variable values non-interactively
                     (repeatable, manifest-driven flow)

-y 是CI友好型开关:一个标志,没有提示。当缺少所需的变量或环境变量时,它将拒绝而不是默默地替换默认值——在重新运行之前显式设置这些变量。

清单环境变量值按优先级顺序解析 --var >流程环境>交互式提示,因此导出的令牌(或显式令牌) --var NAME=VALUE)使 add 即使没有,也完全非交互式 -y.

Codex特定行为:HTTP服务器获得顶级 experimental_use_rmcp_client = true 兼容性开关(旧版Codex要求它加载可流式传输的http MCP服务器;新版本默认为rmcp并容忍密钥),以及作为 Authorization: Bearer 标题写为 bearer_token_env_var = "<NAME>" 令牌保留在环境中,从不在配置文件中,而不是明文标头。使用 --global 当Codex运行时 --remote/应用服务器,从以下位置加载MCP服务器 ~/.codex/config.toml (CODEX_HOME)而不是项目级文件。

Kimi代码特定行为:条目以Kimi的原生形状编写——显式 transport 歧视者,本地人 env stdio表,以及 bearerTokenEnvVar 而不是明文 Authorization HTTP的头部。Kimi加载三个MCP文件(~/.kimi-code/mcp.json,项目根 .mcp.json 它与Claude Code共享,项目本地 .kimi-code/mcp.json)并将它们合并 每个服务器密钥,后来的文件获胜。两个后果: remove 在项目上,本地文件不会卸载共享根目录的服务器 .mcp.json 还声明并隐藏这样的服务器需求 enabled: false 而不是遗漏(见下文)。

清单服务器配置或每个代理的覆盖可能包含 enabled: false 编写一个代理加载但保持关闭的条目。这掩盖了从早期配置层继承的服务器——它存在的情况是只有Claude Code理解的stdio侧通道,否则在Kimi下启动时会失败。没有等效概念的代理忽略该字段,从不编写它。

将服务器安装到中央存储库中(install)

add 当它拉取远程清单时,写入中央存储库作为副作用。如果您只想注册服务器而不涉及任何项目,请使用 install:

mcpsmgr install owner/repo                  # GitHub source (manifest or README scan)
mcpsmgr install https://github.com/o/r
mcpsmgr install ./my-mcp.json               # any agent's MCP JSON shape
mcpsmgr install ~/workspace/my-mcp-server   # local project directory
mcpsmgr install                             # interactive manual flow

GitHub资源也在更新 ~/.mcps-manager/bundles.json 所以稍后 add repo 调用可以解析回repo声明的每个服务器。

部署到代理(deploy)

cd your-project
mcpsmgr deploy             # pick which central servers to deploy
mcpsmgr deploy --refresh   # re-sync existing project entries from central

deploy 自动检测项目已使用的代理(是否存在 .claude.json, .codex/等等),并且只写这些。 --refresh 在您调整中央存储库中的服务器定义并希望每个项目都接受更改后,这是正确的命令。

检查和拆卸

mcpsmgr list                  # central repository
mcpsmgr list --deployed       # what's wired up in the current project
mcpsmgr remove <name>         # remove from the current project (per-agent prompt)
mcpsmgr uninstall <name>      # remove from the central repository
mcpsmgr update [name]         # re-analyze sources and patch central definitions

remove 仅涉及项目代理配置。 uninstall 删除中心条目(并从它所属的任何包中删除它)。

支持的代理

代理 配置位置 范围 格式
克劳德代码 .mcp.json 项目 JSON
食品法典委员会 .codex/config.toml 项目 TOML
光标 .cursor/mcp.json 项目 JSON
Gemini CLI .gemini/settings.json 项目 JSON
OpenCode opencode.json 项目 JSON
基米代码 .kimi-code/mcp.json 项目 JSON
反重力 ~/.gemini/antigravity/mcp_config.json 全局 JSON
OpenClaw ~/.openclaw/openclaw.json 全局 JSON5
爱马仕代理商 ~/.hermes/config.yaml 全局 YAML

Gotcha——全球代理商。 Antigravity、OpenClaw和Hermes Agent在机器上的每个项目中共享一个配置。 add 和 deploy 默认情况下不选中它们;只有当你真的想在主机范围内进行更改时,才勾选它们。

代理ID -a 旗帜。 claude-code, codex, cursor, gemini-cli, opencode, antigravity, openclaw, hermes-agent, kimi-code.

GitHub捆绑包(反向查找)

当一个GitHub仓库通过以下方式声明多个MCP服务器时 mcpsmgr.json, mcpsmgr 将它们记录为一个 束首次安装后,这些输入中的任何一个都会解析到同一组服务器,而不会返回网络:

mcpsmgr add jtianling/cross-agent-teams-mcp        # owner/repo
mcpsmgr add https://github.com/jtianling/cross-agent-teams-mcp
mcpsmgr add cross-agent-teams-mcp                  # bare repo name

捆包存放在 ~/.mcps-manager/bundles.json. install 在每次成功安装清单时更新捆绑包成员资格; uninstall <name> 修剪成员,并在包变空时将其丢弃。

Gotcha——仓库名称冲突。 如果两个不同的GitHub所有者发布了具有相同基名的repo,而你已经安装了这两个库, mcpsmgr add <basename> 将拒绝一份候选人名单。用以下方式消除分歧 owner/repo.

许可证

麻省理工学院