Smart AI Bridge is an enterprise-grade MCP server that provides multi-AI backend orchestration with intelligent routing across 4 specialized backends (coding, analysis, local unlimited tokens, general purpose), featuring automatic failover and health monitoring. It offers enhanced file operations including atomic multi-file writing, intelligent chunking for large files, and advanced batch editing with rollback capabilities. The server includes smart edit prevention through fuzzy matching using Levenshtein distance to reduce "text not found" errors by 80%, supporting strict/lenient/dry_run validation modes. Additional capabilities include direct AI querying to specific models (local, Gemini, DeepSeek, Qwen), comprehensive code review with security and performance analysis, pre-flight validation for changes, system diagnostics with differentiated health checks, backup/restore management, rate limit monitoring, and cross-platform support with automatic service detection for local AI providers.
Enables AI-powered development operations through Google Gemini models as a configurable general-purpose cloud backend with multi-modal capabilities
Integrates with NVIDIA's cloud API platform to access specialized AI models like Qwen for coding tasks and DeepSeek for analysis through intelligent backend routing
Connects to local Ollama model servers for unlimited token processing and private AI operations without API rate limits or usage restrictions
Provides access to OpenAI's GPT models through configurable cloud backends with specialized routing for coding, analysis, and general-purpose AI tasks
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Smart-AI-Bridgereview this Python function for security vulnerabilities"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Smart AI Bridge v2.0.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 20 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 install2. 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 20 tools will be available. Verify with:
@check_backend_health({ "backend": "local" })Tools (20)
Token-Saving File Operations
Tool | Savings | Description |
| 90% | Backend reads and analyzes files, returns structured findings |
| 95% | Backend applies natural-language edits, returns diff |
| 90%/file | Analyze multiple files via glob patterns |
| 95%/file | Apply same instructions across multiple files |
| 80% | Generate code from a natural-language spec |
| 90% | Answer codebase questions using intelligent search |
| -- | Raw file content (prefer |
Multi-AI Workflows
Tool | Description |
| Smart routing with auto or forced backend selection |
| Multi-AI consensus across configurable backends |
| Generate, review, fix loop between two backends |
| TDD workflow with decomposition and quality gates |
| Specialized AI agents (10 roles including TDD) |
Code Quality
Tool | Description |
| Security, performance, and quality review |
| Cross-file refactoring with reference updates |
| Pre-flight validation for proposed changes |
Infrastructure
Tool | Description |
| Health diagnostics for specific backends |
| Timestamped backup management |
| Atomic multi-file writes with backup |
| Multi-turn conversation threading |
| Usage analytics and optimization recommendations |
Smart Routing
The router selects backends using a 4-tier priority system:
Forced -- explicit backend selection (
model="my_backend")Learning -- learned preferences from past outcomes (>0.7 confidence)
Rules -- complexity and task-type heuristics
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).
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
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
Document | Description |
Version history | |
Full configuration reference | |
Adding backends, handlers, and tools | |
Usage examples | |
Dashboard setup and API | |
Council 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
License
Apache-2.0