ai-bridge
Integrates with a local Ollama instance to expose local vision-language models such as qwen2.5-vl-local through the bridge.
Provides an OpenAI-compatible API layer (/v1/models, /v1/chat/completions) so OpenAI SDKs and compatible clients can list models and tools, dispatch tasks, and access proxied models.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
AI Bridge
Local-first MCP hub that turns the AI coding CLIs you already have into one dispatchable tool fleet.
AI Bridge is a resident HTTP service (default 127.0.0.1:9800) that sits between your agent and the AI tools already installed on your machine. It registers external coding CLIs — Claude Code, OpenCode, Qoder, Atom Code, OpenClaw, WorkBuddy, Codely, Agnes MCP and more — as dispatchable tools, exposes them through a 16-tool MCP server, and serves OpenAI- and Anthropic-compatible endpoints so existing clients can reach the same fleet unchanged.
Runtime footprint: one dependency (ws), ~15,300 lines of JavaScript across 42 files, no build step.
Why
Problem | What AI Bridge does |
Many heterogeneous AI CLIs, each with its own invocation shape | One registry + one |
Agents can't see what ran, what it cost, who called it | Traffic capture, token accounting, per-client ACL, structured logs |
Parallel agent sessions trample each other's files | Per-task workspace isolation with create/list/restore |
Cloud relays are a privacy and latency liability | Loopback-first: binds |
Clients speak different protocols | MCP (stdio bridge) + OpenAI |
Related MCP server: Commons
Quick start
npm install # installs the single dependency (ws)
node server.js # listens on 127.0.0.1:9800Point an MCP client at the stdio bridge:
// claude_desktop_config.json / .cursor/mcp.json
{ "mcpServers": { "ai-bridge": { "command": "node", "args": ["<repo>/bridge-stdio.js"] } } }Health check:
curl http://127.0.0.1:9800/api/health
# {"status":"ok","uptime":…,"port":9800,"clients":…,"version":"1.1"}Optional Windows service install: install-service.ps1 / install-service.bat (node-windows or NSSM); register-autostart.ps1 for logon start. Uninstall: uninstall-service-nodewin.js.
MCP tools (16)
bridge-stdio.js exposes the hub to any MCP client:
Tool | Purpose |
| Send a task to one or more registered CLI tools (auto-fallback) |
| Poll an async task until a terminal state |
| Inspect and switch the tool fleet on/off |
| Registry and ACL for calling agents (register/approve/deny/kick) |
| Transfer an in-flight task between tools |
| Multi-model discussion session (inject / interrupt / auto-stop) |
| Isolated per-task working directories |
| Structured event log query |
| Cross-session memory retrieval |
| Token accounting per tool/day |
| Vision pass-through to a local OCR/vision endpoint |
HTTP surface
47 /api/* routes plus protocol-compatible endpoints. Grouped:
Group | Routes |
Health & metrics |
|
Tool fleet |
|
Dispatch & tasks |
|
Discussions |
|
Memory |
|
Observation |
|
Traffic & usage |
|
Clients & ACL |
|
Workspaces |
|
Compatibility |
|
Security model
Defaults are chosen for a single-user workstation; every claim below is backed by code:
Loopback by default.
AI_BRIDGE_HOSTdefaults to127.0.0.1. The peer check readsreq.socket.remoteAddressat exactly one place —isLoopbackPeer()(server.js:1112) — so/api/*,/v1/*and/proxy/*cannot disagree about who is local.Constant-time credential compare.
checkAuth()(server.js:1123) compares length first, thencrypto.timingSafeEqual, avoiding theRangeErrortrap on unequal lengths.Unauthenticated relaying is refused off-loopback. The proxy gate is
isLoopbackPeer(req) || (!!CONFIG.AUTH_TOKEN && checkAuth(req))(server.js:1195): with no token configured, non-loopback callers cannot turn the hub into an open LLM relay. SpoofedX-Forwarded-For: 127.0.0.1is ignored — only the socket peer counts.Per-client ACL. Callers register and must be approved;
deny/kickrevoke. Pending registrations are tracked separately from the active registry.Runtime data never enters version control.
.gitignoreexcludeslogs.jsonl*,traffic.jsonl,token-stats.json,memory.json,switches.json,clients-acl.json,workspaces.json,.env,*.local, and the locally-retainedcodely-client.js.See SECURITY.md for the threat model and reporting channel.
Configuration
32 environment variables, all optional. Grouped:
Group | Variables |
Network |
|
Storage |
|
Dispatch |
|
Clients |
|
Discussions |
|
Sampling & cache |
|
Upstream & vision |
|
Testing
Eight .mjs suites plus legacy .js suites:
npm test # test-unit + test-workspace + test-store-corrupt + test-e2e
npm run lint # eslint over .js and .mjsSuite | Covers |
| Core units, tool registry, routing score |
| Workspace isolation, create/list/restore |
| Persistence under corrupted/partial state |
| End-to-end dispatch against a hub instance |
| Off-loopback auth and proxy gating |
| Regression locks for audited defects |
| Async task progress states |
| Internal bookkeeping freshness (optional) |
⚠️
test-e2e.mjsbinds a fixed port. Do not run the suite while a production hub is listening on it.
CI runs lint and the test suites on push and pull request: .github/workflows/ci.yml.
Extending
Tool adapters live in adapters/:
File | Role |
| Adapter contract (detect / execute / normalize) |
| Spawn a local CLI, capture stdout, normalize the result |
| Call an HTTP tool endpoint |
Adding a tool = one adapter module + a tools.json entry (id, name, command/commandPaths, enabled, available).
Limitations and non-goals
Windows-first packaging. Service install scripts target node-windows/NSSM; on Linux/macOS run
node server.jsunder your own supervisor.Compatibility shim, not a full API.
/v1/*covers chat completions, model listing and Anthropic messages — enough for clients and tests, not every upstream feature.Ships no models. AI Bridge orchestrates tools you already have; it does not host weights.
Single-user by design. The ACL separates callers, but there is no multi-tenant quota or billing layer.
Related
QiDi-Agent — the orchestration framework (task splitting, interface contracts, three-layer quality checks, multi-path merge) this hub was extracted from. AI Bridge is the runtime; QiDi-Agent is the framework layer.
License
MIT © Qidi AI — see LICENSE.
AI Bridge 是一个常驻本机 HTTP 服务(默认 127.0.0.1:9800)的 MCP 中枢:把你机器上已装的各种 AI 编程 CLI(Claude Code、OpenCode、Qoder、Atom Code、OpenClaw、WorkBuddy、Codely、Agnes MCP 等)注册成可派发的工具,通过 16 个 MCP 工具暴露给任意 MCP 客户端,同时提供 OpenAI / Anthropic 兼容端点,让现有客户端不改代码就能调用同一批工具。
特点:依赖只有一个 ws、约 15,300 行 JS、无需构建;默认只绑回环、凭据恒定时间比较、非回环无凭据拒绝透传;带流量留痕、token 记账、客户端 ACL、按任务隔离工作区、多模型讨论会话(可注入/中断/自动止损)。
它是 QiDi-Agent 框架拆出来的运行时层:QiDi-Agent 负责任务拆分、接口契约、三层质检与多路合并,AI Bridge 负责把这些能力变成可被任意 Agent 调用的服务。
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Real-time chat hub for AI agents — Claude Code, Cursor, Cline, Codex over MCP or REST.
MCP server for your apps' tools and custom tools, plus hosted AI agents and approval-gated workflows
Chat, image, video, and audio models from many vendors behind one remote MCP server and one key.
Shared memory for your AI tools: tasks, notes and context every tool can read and write over MCP.
Related MCP Servers
FlicenseNot gradedqualityAmaintenanceEnables orchestrating multiple AI coding tools (Claude Code, Codex CLI, Gemini CLI) on shared repositories with file locking, knowledge capture, task planning, and drift detection via an MCP server.166-- AlicenseBqualityBmaintenanceLets multiple AI agents and parallel coding sessions share one memory and task ledger, so they can claim work instead of duplicating it, resume each other's handoffs and reasoning, and use credentials without ever seeing the keys. Connects assistants such as Claude Code, Codex, Cursor, Gemini, ChatGPT and custom agents over MCP, backed by a single local SQLite file or a self-hosted Postgres hub.411MIT
- FlicenseNot gradedqualityAmaintenanceThis local MCP server lets a primary AI assistant delegate tasks in parallel to specialized sub-agent CLIs (Gemini, Claude, Codex, Cursor) that share the same project context, then aggregates and synthesizes their findings into one response. It uses existing CLI tools and API subscriptions with no markup, supporting 26+ MCP-compatible IDEs.-
- FlicenseNot gradedqualityAmaintenanceEnables a primary AI coding assistant to delegate work in parallel to multiple specialized AI CLI tools (Gemini, Claude, Codex, Cursor) sharing the same project context, then aggregates their findings into a single synthesized response. Runs locally as an MCP server with zero markup, using existing CLI tools, API keys, and subscriptions across 26+ IDE clients.-