Skip to main content
Glama

mcpgo

通过对话管理你的 Claude Code MCP——列出、重启、包装等。

适用于 Claude Code 可用的所有环境,包括 远程控制(Remote Control)模式,该模式下 /mcp 不可用。

安装

npm install -g @exfil/mcpgo
claude mcp add mcpgo --scope user -- mcpgo

要求: Node.js ≥ 18

Related MCP server: MCP Server Generator

远程控制

Claude Code 的远程控制模式无法访问 /mcp。这意味着你无法远程列出、重启或管理 MCP 服务器——除非你拥有 mcpgo。

由于 mcpgo 本身就是一个 MCP 服务器,因此它在 Claude Code 可用的任何地方都可用:

"list my mcps"
"restart github"
"check postgres health"

无需 /mcp 界面。

功能

可靠的重启

Claude Code 通过启动时创建的管道连接到 stdio MCP 服务器。如果服务器崩溃或你想重启它,Claude Code 会将其标记为失败,且没有自动恢复机制。

mcpgo 通过 包装器 解决这个问题:一个长期运行的进程,位于 Claude Code 和你的 MCP 之间。Claude Code 与包装器(保持存活)通信,而包装器将真实服务器作为子进程启动——并在其被杀死时自动重新生成。

包装是 可选的——你可以仅使用 mcpgo 来列出、添加或移除 MCP,而无需包装任何内容。只有当你希望在不接触 /mcp 的情况下获得可靠重启时,才需要包装。

每个 MCP 的一次性设置:

  1. wrap_mcp_stdio — 在配置中包装目标 MCP

  2. 重启 Claude Code(或通过 /mcp 断开并重新连接)

  3. 完成——随时使用 restart_mcp_process

设置完成后:

"restart github"     → instant, wrapper auto-respawns the child, Claude Code stays connected
"restart postgres"        → same

如果你想取消包装,请使用 unwrap_mcp_stdio 恢复原始配置。

工具

进程管理

wrap_mcp_stdio

包装 Claude Code stdio MCP 以实现可靠重启。

"wrap github"
"wrap postgres"

unwrap_mcp_stdio

将已包装的 MCP 恢复为原始配置。

"unwrap github"
"unwrap postgres"

restart_mcp_process

重启已包装 MCP 的子进程——包装器会自动重新生成它,Claude Code 保持连接。

"restart github"
"restart postgres"

check_mcp_health

检查 MCP 是否已配置、已包装,以及其进程是否正在运行。

"check github health"
"is postgres running?"

Codex CLI 支持

wrap_codex_mcp_stdio

~/.codex/config.toml 包装 Codex CLI MCP。

"wrap my codex mcp called postgres"

restart_codex_mcp_process

重启已包装的 Codex CLI MCP。

"restart the codex postgres"

配置管理

list_all_mcps

列出所有已配置的 MCP 服务器。

"list my mcps"
"what mcps do I have?"

add_mcp

~/.claude.json 添加新的 MCP 服务器。

"add an mcp called my-tool that runs python server.py"

remove_mcp

移除 MCP 服务器。

"remove the my-tool mcp"

configure_mcp

更新现有 MCP 服务器的配置字段。

"change github's command to python3"

get_mcp_details

获取特定 MCP 的完整配置详情。

"show me the github config"
"get details for postgres"

包装的工作原理

当你调用 wrap_mcp_stdio "github" 时,配置条目从:

{ "command": "python", "args": ["server.py"] }

变为:

{
  "command": "node",
  "args": [
    "/path/to/wrapper.js",
    "--name", "github",
    "--pidfile", "...",
    "--env-allowlist", "PATH,Path,PATHEXT,HOME,USERPROFILE,SystemRoot,...",
    "--",
    "python", "server.py"
  ]
}

包装器:

  • 将原始命令作为子进程启动

  • 将子进程的 PID 写入 pidfile

  • 在子进程退出时自动重新生成(带退避)

  • 向子进程传递精选的环境变量(PATH、locale、temp、home,以及 MCP 声明的 env 键),而不是继承 Claude Code 的完整环境

  • 在 SIGTERM、SIGINT 或 stdin EOF 时干净退出

restart_mcp_process 读取 pidfile 并杀死子进程。包装器会重新生成它——Claude Code 永远不会看到断开连接。

unwrap_mcp_stdio 会逆转此过程——它从 -- 之后的参数中恢复原始命令,并移除 pidfile。

稳定的包装器位置

当你包装 MCP 时,mcpgo 会将 wrapper.js 复制到一个稳定的用户数据位置,并将该路径写入 ~/.claude.json。这意味着配置在 npx 缓存清除和 mcpgo 版本升级后仍然有效——包装器不会从你脚下消失。

  • Windows: %LOCALAPPDATA%\mcpgo\wrapper.js

  • Linux/macOS: ~/.mcpgo/wrapper.js

对已包装的 MCP 重新运行 wrap_mcp_stdio 会就地刷新包装器副本。

Pidfile 位置

  • Windows: %LOCALAPPDATA%\mcpgo\pids\<name>.pid

  • Linux/macOS: $TMPDIR/mcpgo/pids/<name>.pid

注意事项

  • 包装需要重启 Claude Code(或手动通过 /mcp 断开并重新连接)才能生效——Claude Code 会在内存中缓存配置

  • restart_mcp_process 对已包装的 MCP 效果最佳;对于未包装的 MCP,它会杀死进程,但你需要通过 /mcp 手动重新连接

  • 请求中途崩溃可能导致短暂的协议失步;Claude Code 会在下一次工具调用时恢复

  • 已包装的 MCP 会收到精选的环境变量(PATH、locale、temp、home,以及 MCP 声明的 env 键),而不是完整的 Claude Code 环境。对之前已包装的 MCP 重新运行 wrap_mcp_stdio 以采用此默认设置

  • list_all_mcpsget_mcp_details 默认会编辑 env 值,因此这些工具无法被用来窃取 MCP 配置中存储的机密——当你确实需要查看它们时,请传递 show_env_values: true

Install Server
A
license - permissive license
A
quality
D
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

View all related MCP servers

Related MCP Connectors

  • Augments MCP Server - A comprehensive framework documentation provider for Claude Code

  • Hosted MCP server connecting claude.ai, ChatGPT and other AI apps to your own computer

  • Personal assistant MCP server with search, execute, packages, jobs, secrets, and integrations.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/jschoemaker/mcpgo'

If you have feedback or need assistance with the MCP directory API, please join our Discord server