
Cli Bridge Mcp
io.github.JoaoBerne由 GitHub 帳號 JoaoBerne 發布v0.3.0更新於 Oct 24, 2026
Other AI CLIs (Gemini, GPT, Claude, opencode, Ollama) as a council — ban-safe, no API keys.
概覽
讓助理把本機已安裝的其他 AI CLI(Claude Code、Codex、Gemini、Ollama 等)當成多模型議事團來諮詢,不需 API 金鑰。
- 可以做什麼
- 諮詢其他 AI CLI:向單一通道提問、平行分送給所有免費通道、依由便宜到最強串接,或由路由器挑選,並可列出與重播對話執行緒
- 透過委派建置程式碼:隔離模式回傳暫存工作區的 diff,直寫模式只在宣告的區域內寫入檔案,非同步工作可檢視或介入
- 審查與比較:多模型 diff 審查、帶同儕投票的盲評辯論、預設工作流程,以及依暫存變更產生提交或 PR 文字
- 維運通道:查看工作狀態、為通道評分、記錄通道成本、執行診斷與初始化
- 讀取用量與通道健康資源,可選啟用批次分送與通道狀態重設
- 適用情境
- 適合想就程式碼、缺陷、方案或遷移決策聽取第二、第三個模型意見,或需要跨模型審查與辯論時使用,直接沿用本機已安裝並登入的 CLI,而不必新增 API 金鑰。
- 執行需求
- 透過 uvx 從 cli-bridge-mcp 的 PyPI 套件以 stdio 在本機執行。需要 Python 3.12+、uv,以及至少一個已安裝並登入的 AI CLI。可用 CLI_BRIDGE_PROFILE、CLI_BRIDGE_CACHE_TTL_S、CLI_BRIDGE_TERSE 及各通道設定等環境變數調整成本、快取與輸出風格。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Cli Bridge Mcp,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
cli-bridge
A Model Context Protocol server that lets the AI assistant
you're talking to consult the other AI CLIs installed on your machine — Claude Code, Codex,
Gemini, Mistral, opencode, Ollama, Apple fm, … Each lane spawns the official CLI as a
subprocess: no API keys, no token extraction, read-only by default.
Dependencies: the Python stdlib and mcp (1.x or 2.x). No daemon.
What it does
Every ask_<lane> returns a thread id; reuse it (even on another lane) for a multi-model
conversation that survives /compact. conversations lists or replays threads.
Tools
15 fixed tools + one ask_<lane> per installed CLI:
- Consult:
ask_<lane>,ask_all,ask_cascade,ask_best,conversations,list_models - Build:
ask_build(mode=isolated→ diff,mode=direct→ zone-guarded writes; withmode=direct,async=true→ steerable viajob) - Review:
review_diff(focus=code|security),debate(vote=judge|borda),workflow(presets:refine_plan,map_review,research_verify,fanout_compare,converge,premortem,test_plan,challenge),git_text(kind=commit|pr) - Operate:
job(action=status|result|cancel|list|tail|steer),rate_lane,set_lane_cost,doctor,setup
CLI_BRIDGE_TOOLS=all adds batch_run (journaled fan-out) and reset_lane_state;
CLI_BRIDGE_TOOLS=default,batch_run extends the default; a plain comma list is exactly those.
Usage and lane health are MCP resources (cli-bridge://usage-summary, cli-bridge://lane-stats).
Full reference: docs/TOOLS.md.
There is also a human CLI, cli-bridge doctor|ask|ask-all|ask-best|build|review-diff|security-review|test-plan|premortem|stats|usage|jobs|set-cost (--json where it makes sense). cli-bridge build <lane> "<task>" prints the worktree diff; --apply lands it as unstaged changes.
Writing code safely
isolated(default): the delegate edits a throwaway git worktree and you get a diff. Your tree is untouched.direct: writes real files, but only inside thezoneyou declare, behind a per-zone lock with a post-turn zone-violation check; undo is zone-scoped.async=truemakes it steerable (job action=tail|steer) with an executable Definition-of-Done (dod_cmd).
CLI_BRIDGE_VERIFY_PLAN_READONLY=1 flags (never reverts) a read-only delegate that wrote files
anyway. Re-entry is depth-capped (CLI_BRIDGE_MAX_DEPTH, default 1). Delegates run in the
caller's cwd, else CLI_BRIDGE_DEFAULT_CWD, else the host's MCP workspace root.
Install
Prerequisites: Python 3.12+, uv, and at least one AI CLI installed and logged in.
Wire it into your host:
- Claude Code:
claude mcp add cli-bridge -- uvx cli-bridge-mcp(or the plugin:claude plugin marketplace add JoaoBerne/cli-bridge-mcp && claude plugin install cli-bridge@cli-bridge-mcp). - Any other MCP host (Codex, Cursor, VS Code, Zed, Claude Desktop, …):
Per-host config paths:
docs/HOSTS.md. Full example with env vars:examples/mcp.example.json. GUI hosts launch servers with a minimal PATH; cli-bridge also searches the usual install dirs, or point a lane at its binary withCLI_BRIDGE_<LANE>_BIN=/full/path.
Restart the host, then ask it to consult a lane ("ask gemini to read ./src and find the bug").
cli-bridge-mcp is the server entry point; cli-bridge is the human CLI.
Configuration
Everything is env (set in the MCP server entry) or ~/.config/cli-bridge/config.json (env wins).
The knobs that matter:
doctor --deep (or doctor(deep=true)) live-checks every free lane, its CLI version and its
model list, and reports what changed since the previous deep probe: run it weekly and you learn
about a renamed flag or a new model before a delegation fails.
set_lane_cost (or cli-bridge set-cost) records what a lane costs you, persisted to the
config file. Cost tiers are sourced defaults, never read from your account
(docs/COSTS.md); the full spend model is in docs/BUDGET.md.
Lanes
Built-in: Claude Code, Codex (gpt), Gemini (+ Antigravity agy), Mistral (Vibe), opencode,
Ollama (local, $0), Apple Foundation Models (fm, on-device, $0), Qwen Code, Copilot, Cursor,
Grok, and Apple PCC (hidden until APPLE_FM_SERVE_URL is set — it talks to a fm serve you
start from Terminal yourself; see examples/apple-fm-serve.lane.json).
images=[…] works on the vision lanes (apple, ollama, opencode, gpt, gemini); whether the image is
actually read depends on the model behind the lane.
Other CLIs are a few lines of JSON via CLI_BRIDGE_LANES_FILE:
examples/local-runtime.lane.json (LM Studio, MLX, llama.cpp;
runtime table in examples/local-first-host.md),
examples/community-lanes.json (Aider, Goose, Plandex, Amp,
Crush, Amazon Q, Droid), and any OpenAI-compatible endpoint via curl or the bundled
cli-bridge-openai bridge (examples/openai-compatible.lane.json).
Known limitations
- No token or key extraction, but non-interactive use of a vendor CLI isn't formally sanctioned everywhere.
- Async jobs are in-process: a server restart marks running jobs
interrupted.batch_run/workflowjournal each task and resume viaresume_id. - The injection guard is heuristic. Treat delegate output as data.
- Token/credit figures are estimates (chars/4 × your
CREDITS_PER_1K). - Experimental lanes (
qwen,copilot,grok, community,images=):doctor --deepchecks each CLI's--helpon your machine.
Development
Eval harness (deterministic scorer, outside the package): benchmarks/.
History: CHANGELOG.md. Layout and rules: AGENTS.md, docs/ARCHITECTURE.md.
License
Apache 2.0
來源:README.md,提交 ee62f24
工具
0版本歷史
1- v0.3.0最新Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分