FluxRoute
Relays mid-workflow subtasks to Gemini Pro, Flash and Lite models via header-only x-goog-api-key authentication, offloading boilerplate, test stubs and formatting steps to cheaper Gemini tiers (or escalating to Gemini Pro for high-complexity phases) while tracking live savings.
Discovers locally running Ollama daemons (127.0.0.1:11434) and pulls their model list into the routing catalog, allowing eligible workflow steps to be delegated to local models at zero token cost and without sending code off the machine.
Routes workflow steps to OpenAI models (GPT-4.1+, o3, Mini/Nano) using Authorization header authentication, escalating to frontier reasoning models after repeated test/compiler failures and downgrading routine CRUD or formatting work to mini/nano tiers with cost tracking.
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.
Overview
FluxRoute is a real-time intra-workflow multi-LLM model router built as a unified MCP Server + Interactive MCP App UI, Antigravity Plugin (Hooks + Skill + Rules), Universal Coding Agent Skill, and VS Code Extension.
Traditional LLM routers only inspect the initial user prompt on Turn 1. In real engineering sessions, a single prompt often spans multiple distinct phases:
Steps 1–3 (High Complexity): Distributed state design, security auditing, or race-condition debugging — requires frontier capability (Claude Opus / Sonnet, OpenAI o3 / GPT-4.1+, Gemini Pro).
Steps 4–8 (Routine Execution): Generating CRUD boilerplate, writing basic unit test stubs, formatting files, or updating
README.md— tasks where Gemini Flash, GPT Mini/Nano, Claude Haiku, or Local Ollama deliver identical reliability at 85–95% lower cost.Mid-Task Failure Loops: Conversely, if you start on a lightweight economy model and hit 2+ consecutive test/compiler failures, staying on that model wastes developer time and requires immediate Frontier Escalation.
FluxRoute intercepts every step inside an active workflow in <40ms via IDE lifecycle hooks and MCP tools—firing real-time desktop & inline alerts, asking manual permission (Manual Gate), or automatically offloading subtasks (Auto Relay) with compact git-aware Context Handoff Capsules.
Related MCP server: mcp-llm-bridge
Key Highlights
Zero Hardcoded Pricing or Fake Telemetry:
Dynamically syncs 360+ live interactive LLMs (excluding offline
:batchqueues and non-chat audio/image endpoints) directly from OpenRouter's live catalog API (https://openrouter.ai/api/v1/models) plus locally running Ollama daemons (http://127.0.0.1:11434/api/tags).Stores every evaluation, policy change, and API token/USD execution in a local WAL-mode SQLite database (
node:sqlite) starting strictly at0.
Four Real-Time Operating Modes:
manual_ask(Manual Gate): Pauses at genuine workflow phase transitions (force_ask/ VS Code modal toast) so you can approve or decline model switches in real time.auto_switch(Auto Relay): Automatically delegates routine mid-workflow steps to fast economy models (or lightweight subagents) while notifying you in the background.notify_only(Signal Only): Non-blocking OS desktop toast alerts and live SQLite savings tracking without interrupting tool calls.off(Bypass): Disables routing hooks immediately.
Smart Context Handoff Capsules:
Switching models mid-session normally breaks KV prompt caches or wastes tens of thousands of tokens re-sending raw chat transcripts. FluxRoute inspects live
git status, active branch, modified files, and JSONL conversation trajectories to build a ~200–600 token Markdown Capsule ready for instant handoff.
Handcrafted Instrument Console (
ui://fluxroute/dashboard.html):Custom pixel-aligned vector iconography and an animated mechanical Rotary Relay Schematic (zero generic emojis or stock AI templates) supporting both Dark (Brushed Obsidian) and Light (Archival Vellum) host themes.
Enterprise-Grade Security Architecture:
AES-256-GCM Encrypted Key Vault: Provider API keys stored at rest use authenticated encryption (
enc:v1:<iv>:<tag>:<ciphertext>).Prompt-Injection Privilege Separation: LLM-callable MCP tools cannot read/modify API keys or external webhook URLs; credential management is strictly isolated to the human-only MCP App iframe (
visibility: ['app']) and local CLI/environment variables.DLP Credential Scrubber & Free-Tier Privacy Gate: Automatically redacts accidental API keys, GitHub PATs, AWS keys, Bearer tokens, and PEM private keys from logs/notifications and blocks routing proprietary code to
:freeshared-logging endpoints by default.Header-Only Upstream Auth & SSRF/DNS-Rebinding Guards: Gemini (
x-goog-api-key), Anthropic (x-api-key), and OpenAI (Authorization) credentials never appear in URL query strings; webhooks block private LAN and cloud metadata IPs (169.254.169.254); Streamable HTTP/mcpenforces loopbackHost,Origin, constant-time Bearer token auth, and1 MiBpayload limits.
Architecture & Mid-Workflow Lifecycle
flowchart LR
subgraph Clients["AI Coding Environments"]
AGY["Google Antigravity\n(Plugin + Hooks + Side-Pane UI)"]
VSC["VS Code Extension\n(@router + vscode.lm + Watcher)"]
MCP_HOSTS["ChatGPT / Claude / Cursor\n(Stdio & Streamable HTTP /mcp)"]
end
subgraph Core["@fluxroute/core Engine"]
HOOK["Lifecycle Hook Runner\n(Phase-Shift Hysteresis)"]
ANA["Multi-Signal Analyzer\n(AST + Transcript + Cache Math)"]
HO["Git & Trajectory\nHandoff Capsule Builder"]
SEC["Security Layer\n(AES-256-GCM + DLP + SSRF Guard)"]
DB[("Native SQLite WAL\nfluxroute.sqlite")]
end
subgraph Providers["Live LLM Ecosystem"]
GEM["Google Gemini\n(Pro / Flash / Lite)"]
CLAUDE["Anthropic Claude\n(Opus / Sonnet / Haiku)"]
OAI["OpenAI / ChatGPT\n(GPT-4.1+ / o3 / Mini / Nano)"]
OR["OpenRouter / DeepSeek / Grok"]
OLLAMA["Local Ollama\n($0 Loopback)"]
end
AGY --> HOOK
AGY <--> Core
VSC <--> Core
MCP_HOSTS <--> Core
HOOK --> ANA
ANA <--> DB
SEC <--> DB
Core --> HO
Core --> GEM & CLAUDE & OAI & OR & OLLAMAMonorepo Structure
FluxRoute/
├── docs/
│ └── banner.svg # Handcrafted SVG schematic banner
├── packages/
│ ├── core/ # @fluxroute/core — Analyzer, SQLite WAL DB, Vault, Catalog, Executor, Hooks
│ ├── mcp-server/ # @fluxroute/mcp-server — Stdio + Streamable HTTP /mcp + Handcrafted UI App
│ ├── antigravity-plugin/ # Ready-to-load Antigravity Plugin + Universal Agent Skill + Standalone CLI
│ │ ├── plugin.json
│ │ ├── mcp_config.json
│ │ ├── hooks.json # SessionStart, PreInvocation, PreToolUse, PostToolUse
│ │ ├── bin/fluxroute-cli.mjs # Zero-dependency bundled Node ESM binary
│ │ ├── rules/AGENTS.md
│ │ └── skills/fluxroute-model-router/SKILL.md
│ └── vscode-extension/ # fluxroute-vscode — @router Chat Participant, Watcher, CSP Webview & .vsix
├── scripts/
│ └── bundle-plugin.mjs # Bundles single-file CLI and syncs plugin directories
└── tests/
└── e2e.test.ts # 7-part E2E security, encryption, SSRF, hysteresis, MCP & UI verificationQuick Start & Installation
Prerequisites
Node.js
>= 22.5.0(uses Node's built-innode:sqlite— zero native C++ addon compilation required; verified on Nodev24.xacross Windows, macOS, and Linux).
1. Clone, Build & Verify
git clone https://github.com/Sunil56224972/FluxRoute.git
cd FluxRoute
npm install
npm run build
npm run package:vscode
npm testPlatform Setup Guides
A. Google Antigravity (Plugin + Real-Time Hooks + Side-Pane Console)
npm run build automatically installs the plugin bundle into ~/.gemini/config/plugins/fluxroute (or copy packages/antigravity-plugin there manually):
Enable FluxRoute Smart Model Router on the Customizations → Plugins page.
Open FluxRoute Router from the Side Pane
+menu or send:"Open the FluxRoute live model router dashboard"Real-time
PreInvocation,PreToolUse, andPostToolUsehooks immediately begin monitoring mid-workflow complexity transitions and error streaks.
B. VS Code Extension (.vsix)
Install the packaged extension directly:
code --install-extension packages/vscode-extension/fluxroute-vscode-1.0.0.vsixMention
@routerin VS Code Chat to dynamically route prompts across your installedvscode.lmmodels (Copilot ChatGPT, Claude, Gemini) or direct API keys with interactive approval prompts.Click
FluxRoute [Gate]in the bottom Status Bar to open the live Webview Console or runFluxRoute: Save Provider API Key in Encrypted Vault (AES-256-GCM)from the Command Palette.
C. Claude Desktop / Cursor / Windsurf / Cline (Stdio MCP)
Add the standalone bundled binary to your client's mcp_config.json / claude_desktop_config.json:
{
"mcpServers": {
"fluxroute": {
"command": "node",
"args": [
"--no-warnings",
"/absolute/path/to/FluxRoute/packages/antigravity-plugin/bin/fluxroute-cli.mjs"
]
}
}
}D. ChatGPT Desktop / Remote Connectors (Hardened Streamable HTTP /mcp)
Start the Streamable HTTP server bound to loopback with Bearer authentication:
node --no-warnings packages/antigravity-plugin/bin/fluxroute-cli.mjs \
--http --port 4789 --auth-token "your-strong-secret-token"MCP Endpoint:
http://127.0.0.1:4789/mcpHealth & Posture Check:
http://127.0.0.1:4789/healthz
MCP Tools Reference
Tool | Visibility | Description |
| Model + App ( | Opens the interactive 4-tab FluxRoute Console inline, in the Side Pane, or full-page. |
| Model + App | Evaluates prompt/step complexity ( |
| Model + App | Executes a prompt or delegated routine phase on the optimal configured LLM API ( |
| Model + App | Builds a compact git- and trajectory-aware Markdown Context Capsule for low-token mid-workflow model switching. |
| Model + App | Updates safe operational settings ( |
| Model + App | Syncs fresh live interactive LLM models & per-token pricing from OpenRouter + local Ollama. |
| Model + App | Reads real SQLite evaluations, realized/potential USD savings, provider health, and security posture. |
| App-Only ( | Encrypts and stores provider API keys in the local AES-256-GCM SQLite vault without exposing secrets to any LLM context. |
Provider Credentials (Optional — for Direct route_and_execute)
FluxRoute's real-time IDE switch alerts and Context Handoff Capsules work immediately with zero API keys. To also let FluxRoute execute delegated subtasks directly over provider APIs, add keys via the Security & Vault UI tab or environment variables:
Provider | Environment Variable | Upstream Endpoint |
Google Gemini |
|
|
Anthropic Claude |
|
|
OpenAI / ChatGPT |
|
|
OpenRouter (300+ LLMs) |
|
|
DeepSeek |
|
|
xAI Grok |
|
|
Groq |
|
|
Ollama (Local Free) | (Auto-discovered on loopback) |
|
Verification & Security Suite
Run the full automated test suite (node:test):
npm testVerifies:
Fresh SQLite state (
0fake rows) + live OpenRouter catalog sync filtering out:batchand audio generators.AES-256-GCM encryption at rest in
provider_secrets+ DLP detection & redaction of leaked keys.SSRF & Loopback Guards rejecting cloud metadata (
169.254.169.254), private LAN webhooks, and remote unapproved Ollama hosts.Mid-Workflow Hysteresis allowing complex architecture on Claude Opus, gating on transition to
README.md, and suppressing duplicate prompts inside the same phase.Error-Streak Escalation on consecutive
PostToolUsefailures + LLM privilege separation onconfigure_router_policy.Hardened Streamable HTTP
/mcp(401unauthenticated,403untrusted cross-origin CSRF,200Bearer-authenticated UI resource check).
License
Released under the MIT License.
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
LLM cost optimization gateway, repo token-waste auditor & model arbitrage MCP server.
Shared memory MCP server for Claude Code, Codex, Gemini CLI and Cursor. Cited, editable.
MCP server for your apps' tools and custom tools, plus hosted AI agents and approval-gated workflows
Team memory for AI coding agents and code reviews, reviewed by humans and served over MCP.
Related MCP Servers
- AlicenseAqualityDmaintenanceMCP server orchestrating local CLI agents (Claude Code, OpenAI Codex, Google Gemini) for cross-validation, second opinions, and persona-driven prompting.18MIT
- AlicenseAqualityBmaintenanceCentralized encrypted gateway that routes requests to 11+ LLM providers (API keys and CLI subscriptions) through a single OpenAI-compatible endpoint, with MCP tools for vault operations, code search, and shared state.302MIT
- AlicenseAqualityDmaintenanceOne MCP that turns Claude Code into your whole dev stack by swallowing other MCP servers, delegating to Codex & Gemini on your CLI subscriptions, remembering projects in a searchable knowledge graph, and carrying setup across sessions — secret-free by design.234MIT
- FlicenseBqualityDmaintenanceA fully local, privacy-first MCP server that gives AI coding assistants deep repository intelligence with file-and-line-cited answers, persistent semantic memory, and agentic abilities like task planning and code review—all without any cloud API calls.23-