统一cli-mcp
通过一个通用的MCP服务器公开已安装的编码CLI的独立MCP服务器 ask 工具。
它允许一个MCP客户端直接调用另一个本地CLI。例如:
- 克劳德代码调用Codex
- Codex呼叫双子座
- 副驾驶呼叫光标
支持的后端
在本机器上进行现场烟雾测试:
geminicodexclaudekirokilocopilotopencodemistralcursorqwen
已知除外责任:
qodo:暂时排除,因为上游执行当前返回日落响应amp:已安装,但无头执行模式目前需要付费点数
它暴露了什么
两个MCP工具:
ask(backend, prompt, model?, cwd?, timeout?)backends()
ask 运行一次无头CLI调用。
backends 配置本地二进制文件的报告可用。
安装
直接从GitHub运行 uvx
uvx --from git+https://github.com/dev-boz/unified-cli-mcp unified-cli-mcp作为工具安装 uv
uv tool install git+https://github.com/dev-boz/unified-cli-mcp安装时使用 pipx
pipx install git+https://github.com/dev-boz/unified-cli-mcp本地开发
git clone https://github.com/dev-boz/unified-cli-mcp
cd unified-cli-mcp
uv sync
uv run unified-cli-mcpMCP客户端配置
克劳德代码
claude mcp add -s user unified-cli-mcp -- uvx --from git+https://github.com/dev-boz/unified-cli-mcp unified-cli-mcp法典
codex mcp add unified-cli-mcp -- uvx --from git+https://github.com/dev-boz/unified-cli-mcp unified-cli-mcp双子星命令行工具
gemini mcp add -s user unified-cli-mcp uvx --from git+https://github.com/dev-boz/unified-cli-mcp unified-cli-mcpCopilot 命令行界面
用户配置文件: ~/.copilot/mcp-config.json
{
"mcpServers": {
"unified-cli-mcp": {
"command": "uvx",
"args": [
"--from",
"git+https://github.com/dev-boz/unified-cli-mcp",
"unified-cli-mcp"
]
}
}
}项目本地Copilot配置: .mcp.json
{
"servers": {
"unified-cli-mcp": {
"command": "uvx",
"args": [
"--from",
"git+https://github.com/dev-boz/unified-cli-mcp",
"unified-cli-mcp"
]
}
}
}通用stdio配置
{
"mcpServers": {
"unified-cli-mcp": {
"command": "uvx",
"args": [
"--from",
"git+https://github.com/dev-boz/unified-cli-mcp",
"unified-cli-mcp"
],
"env": {
"UNIFIED_CLI_ENABLED_BACKENDS": "gemini,codex,claude,copilot,cursor,mistral",
"UNIFIED_CLI_DEFAULT_TIMEOUT": "300",
"UNIFIED_CLI_ALLOW_DANGEROUS": "1"
}
}
}
}示例提示
在任何MCP客户端内部:
Use the unified-cli-mcp ask tool with backend="codex", cwd="/path/to/repo", prompt="Review this project for parsing bugs. Return only the top 3 findings."Use unified-cli-mcp to ask gemini: "Summarize the architecture of this repo in 5 bullets."Call the ask tool with backend="cursor", prompt="Suggest a refactor plan for the parser layer. No code."备注
- 目标CLI必须已在运行此MCP服务器的计算机上安装并经过身份验证。
- 此服务器是独立的。它不需要
cli-agent-nexus. - 后端别名,如
claude-code,mistral-vibe,以及cursor-agent内部正常化。 - 广泛权限绕过标志现在是选择加入。设置
UNIFIED_CLI_ALLOW_DANGEROUS=1仅当您明确希望桥接CLI在启用信任/自动批准模式的情况下运行时。
发展
python3 -m pytest tests/test_core.py -q
python3 -m compileall unified_cli_mcp