Token导航 LogoToken导航TokenDH.com
Smart AI Bridge logo
办公协作未说明官方级别未说明来源级核验

Smart AI Bridge

MCP Server

Smart AI Bridge是一个配置驱动的多AI编排工具,用于Claude Code,支持智能路由和多AI协作。

工具数

19

提示词数

0

GitHub Stars

2

资源数

0
JavaScriptClaude文件操作Claude DesktopClaude

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

Platano78

提供方

Platano78

最后核验

2026/5/17 20:21

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

详细介绍

Smart AI Bridge v2.4.0

Config-driven multi-AI orchestration for Claude Code. Add any OpenAI-compatible provider, route intelligently, and let multiple AIs collaborate through the council system.

What It Does

Smart AI Bridge is an MCP server that sits between Claude Code and your AI backends. It provides 19 tools for token-saving file operations, multi-AI workflows, code quality checks, and intelligent routing -- all configured through a single JSON file.

  • Any OpenAI-compatible provider works. Local models (vLLM, LM Studio, Ollama), cloud APIs, or a mix of both. The included presets cover common providers, but adding your own is just a config entry.
  • Smart routing selects the best backend per task using a 4-tier system: forced selection, learned preferences, rule-based heuristics, and health-based fallback.
  • Council system queries multiple backends on the same prompt and returns all responses for Claude to synthesize. Configurable strategies (parallel, sequential, debate, fallback) per topic.
  • Web dashboard for managing backends and council configuration without editing JSON files.

Quick Start

1. Install

cd /path/to/smart-ai-bridge
npm install

2. Configure Backends

Backend configuration lives in src/config/backends.json. Set API keys for the providers you want to use:

# Examples -- set whichever keys apply to your backends
export NVIDIA_API_KEY="your-key"
export OPENAI_API_KEY="your-key"
export GEMINI_API_KEY="your-key"
export GROQ_API_KEY="your-key"

You only need at least one working backend (a local model or one cloud API key). See CONFIGURATION.md for the full config reference.

3. Add to Claude Code

{
  "mcpServers": {
    "smart-ai-bridge": {
      "command": "node",
      "args": ["src/server.js"],
      "cwd": "/path/to/smart-ai-bridge",
      "env": {
        "NVIDIA_API_KEY": "your-key",
        "OPENAI_API_KEY": "your-key",
        "GEMINI_API_KEY": "your-key",
        "GROQ_API_KEY": "your-key"
      }
    }
  }
}

4. Restart Claude Code

After restarting, all 19 tools will be available. Verify with:

@check_backend_health({ "backend": "local" })

Tools (19)

Token-Saving File Operations

ToolSavingsDescription
analyze_file~90%Backend reads and analyzes files, returns structured findings
modify_file~95%Backend applies natural-language edits, returns diff
batch_analyze~90%/fileAnalyze multiple files via glob patterns
batch_modify~95%/fileApply same instructions across multiple files
generate_file~80%Generate code from a natural-language spec
explore~90%Answer codebase questions using intelligent search

Multi-AI Workflows

ToolDescription
askSmart routing with auto or forced backend selection
councilMulti-AI consensus across configurable backends
dual_iterateGenerate, review, fix loop between two backends
parallel_agentsTDD workflow with decomposition and quality gates
spawn_subagentSpecialized AI agents (10 roles including TDD)

Code Quality

ToolDescription
reviewSecurity, performance, and quality review
refactorCross-file refactoring with reference updates
validate_changesPre-flight validation for proposed changes

Infrastructure

ToolDescription
check_backend_healthHealth diagnostics for specific backends
backup_restoreTimestamped backup management
write_files_atomicAtomic multi-file writes with backup
manage_conversationMulti-turn conversation threading
get_analyticsUsage analytics and optimization recommendations

Smart Routing

The router selects backends using a 4-tier priority system:

  1. Forced -- explicit backend selection (model="my_backend")
  2. Learning -- learned preferences from past outcomes (>0.7 confidence)
  3. Rules -- complexity and task-type heuristics
  4. Fallback -- health-based fallback through the priority chain

When a backend fails, requests automatically fall to the next healthy backend. Circuit breakers protect each backend (5 consecutive failures trigger a 30-second cooldown).

Response Reliability (v2.4.0)

All handlers use a unified response pipeline (extractResponseText) that correctly handles every known LLM response shape -- raw strings, OpenAI chat/completion formats, thinking model reasoning_content, array content parts, and Gemini candidates. Repetitive output from local models is automatically collapsed, and analysis findings are deduplicated and capped.

Council System

The council queries multiple backends on the same prompt and returns all responses for Claude to synthesize. Topics like coding, architecture, and security each map to a set of backends and a strategy (parallel, sequential, debate, or fallback).

See docs/COUNCIL.md for full documentation.

Dashboard

An optional web dashboard provides UI for backend management (enable/disable, priorities, health checks) and council configuration (strategies, topic mapping).

See docs/DASHBOARD.md for setup and API reference.

Adding a Backend

Via Dashboard (recommended): Start the server with SAB_DASHBOARD=true, then use the web UI at http://localhost:3000 to add, remove, enable/disable, and re-prioritize backends without editing JSON.

Via Config File: Any OpenAI-compatible provider can be added as a config entry in src/config/backends.json:

{
  "name": "my_provider",
  "type": "openai",
  "endpoint": "https://api.my-provider.com/v1",
  "model": "my-model",
  "apiKeyEnvVar": "MY_PROVIDER_API_KEY",
  "maxTokens": 8192,
  "priority": 7,
  "enabled": true
}

See EXTENDING.md for details on adding custom adapter types.

Documentation

DocumentDescription
CHANGELOG.mdVersion history
CONFIGURATION.mdFull configuration reference
EXTENDING.mdAdding backends, handlers, and tools
EXAMPLES.mdUsage examples
docs/DASHBOARD.mdDashboard setup and API
docs/COUNCIL.mdCouncil system details

Requirements

  • Node.js >= 18.0.0
  • At least one backend configured (local model or cloud API key)
  • Claude Code or Claude Desktop for MCP integration

Testing

npm test              # Run 35 unit tests (Vitest)
npm run test:watch    # Watch mode
npm run test:bench    # Performance benchmarks (25 benchmarks, 6 categories)

Security Notes

  • Never commit API keys to version control. Use environment variables exclusively.
  • The Claude Code config examples above use placeholder values -- replace them with your actual keys or reference a .env file.
  • Rotate any accidentally leaked keys immediately.

License

Apache-2.0

目录标签

目录标签

JavaScriptClaude文件操作多AI协作本地部署智能路由代码质量检查AI工作流

支持客户端

Claude DesktopClaude

接入字段

传输方式(transport,传输协议)

未说明

鉴权方式(authType,认证方式)

api-key

工具数量(toolCount,工具数)

19

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

未说明api-key部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

仍需确认:installCommand

来源信息

继续浏览同类 MCP