Skip to main content
Glama
argon-bridge-9router

argon-bridge-9router

by faizalzn
README.md
# πŸš€ Argon Bridge for 9Router & MCP

**A Playwright Web-to-API Bridge & Model Context Protocol (MCP) Server** designed to unlock **Gemini 4 Argon** on **Google AI Pro (Jio Bundle / Gemini Advanced)** accounts and seamlessly integrate it with **[9Router](https://github.com/decolua/9router)** alongside multi-provider fallbacks including **Claude Opus 4.6, Claude Sonnet 4.6, Qoder, OpenCode, and GPT-OSS 120B**.

---

## πŸ’‘ Why Does This Project Exist?

On Google's Cloud Code / Antigravity OAuth API route (`ag/`), access to `gemini-4-argon` is strictly gated behind **Google AI Ultra / Enterprise** tiers. Users with **Google AI Pro** subscriptions (such as the 18-month Jio bundle) receive `404/403` errors when calling Argon via APIβ€”even though they can access Argon through the **Gemini Web UI (`gemini.google.com`)** and hold generous API quotas for partner models (**Claude Opus 4.6**, **Claude Sonnet 4.6**, and **GPT-OSS 120B**).

This project bridges that gap with a **3-in-1 Hybrid Architecture**:
1. **Playwright Persistent Engine:** Automates a persistent Chromium session using your Google AI Pro login profile to interact with **Gemini 4 Argon** directly via the Web UI.
2. **OpenAI-Compatible Local Proxy (`Port 20129`):** Exposes a standard `/v1/chat/completions` endpoint so **9Router** can register Playwright as a custom OpenAI-compatible upstream provider.
3. **Dual-Defense & Multi-Provider MCP Server:** Exposes an MCP tool to your IDE (Cursor, Cline, Roo Code, Claude Desktop) that prioritizes **Gemini 4 Argon (Playwright)** and automatically falls back to **9Router** models (**Antigravity Claude, Qoder, Qwen, DeepSeek**, etc.) if the browser is busy or rate-limited.

---

## 🌐 Supported Models & Providers (Including Qoder!)

Because this project connects directly to **9Router's unified OpenAI-compatible endpoint**, it supports **every provider and model configured in your 9Router instance**:

- **Playwright Web Bridge:** `playwright-gemini-4-argon` (via Local Port `20129`)
- **Antigravity (`ag/`):** `ag/claude-opus-4-6-thinking`, `ag/claude-sonnet-4-6-thinking`, `ag/claude-sonnet-4-6`, `ag/gpt-oss-120b-medium`
- **Qoder (`qoder/`):** `qoder/qwen3-coder-plus`, `qoder/claude-3-7-sonnet`, or any model available under your Qoder account in 9Router
- **Other 9Router Providers:** Kiro (`kiro/`), OpenCodeZen (`opencode/`), GitHub Copilot (`gh/`), Cursor, DeepSeek, Groq, and local Ollama models.

You can dynamically pass **any** model ID via the MCP tool's `target_model` parameter (e.g., `"target_model": "qoder/qwen3-coder-plus"`) or customize the `FALLBACK_MODELS` environment variable.

---

## πŸ› οΈ Quick Installation

```bash
# 1. Clone the repository & install dependencies
git clone https://github.com/faizalzn/argon-bridge-9router-mcp.git
cd argon-bridge-9router-mcp
npm install

# 2. Install the Playwright Chromium binary
npm run setup-browser
```

---

## πŸ” Step 1: One-Time Google (Jio) Authentication

Before running the bridge in headless background mode, save your Google AI Pro login session once:

```bash
npm run login
```

1. A Chromium window will open automatically and navigate to `https://gemini.google.com/app`.
2. Sign in with your Google AI Pro (Jio) account.
3. Select **Argon** from the model selector menu in the top-left corner.
4. **Close the browser window.** Your cookies and session state are permanently saved in `~/.9router-jio-playwright-profile`.

---

## πŸ”— Step 2: Connect with 9Router Dashboard

1. Start 9Router (`9router start`) and open the dashboard at `http://localhost:20128`.
2. Add a new **OpenAI-Compatible Provider**:
   - **Name:** `jio-playwright`
   - **Base URL:** `http://localhost:20129/v1`
   - **API Key:** `sk-local-playwright` (any placeholder string)
   - **Model ID:** `playwright-gemini-4-argon`
3. *(Optional)* Connect your **Qoder** or **Antigravity** accounts under the **Providers** tab in 9Router.
4. Create a **Smart Combo** named **`jio-max-non-gemini`** with the following priority order:
   1. `jio-playwright/playwright-gemini-4-argon` *(Tier 1: Gemini 4 Argon via Web Bridge)*
   2. `ag/claude-opus-4-6-thinking` *(Tier 2: Claude Opus via Jio Quota)*
   3. `ag/claude-sonnet-4-6-thinking` *(Tier 3: Claude Sonnet Thinking via Jio Quota)*
   4. `qoder/qwen3-coder-plus` *(Tier 4: Qoder Coding Fallback)*
   5. `ag/gpt-oss-120b-medium` *(Tier 5: GPT-OSS 120B Safety Net)*

---

## πŸ–₯️ Step 3: Add to MCP Client (Cursor / Cline / Claude Desktop)

Copy the configuration from `mcp.config.example.json` into your IDE's MCP settings file (`claude_desktop_config.json`, `.cursor/mcp.json`, or `cline_mcp_settings.json`):

```json
{
  "mcpServers": {
    "argon-bridge-9router": {
      "command": "node",
      "args": ["/ABSOLUTE/PATH/TO/argon-bridge-9router-mcp/index.js"],
      "env": {
        "NINE_ROUTER_URL": "http://localhost:20128/v1",
        "NINE_ROUTER_KEY": "YOUR_9ROUTER_API_KEY",
        "JIO_COMBO_NAME": "jio-max-non-gemini",
        "FALLBACK_MODELS": "jio-max-non-gemini,ag/claude-opus-4-6-thinking,ag/claude-sonnet-4-6-thinking,qoder/qwen3-coder-plus,ag/gpt-oss-120b-medium",
        "PLAYWRIGHT_BRIDGE_PORT": "20129",
        "HEADLESS": "true"
      }
    }
  }
}
```

---

## βš™οΈ MCP Tool Parameters (`ask_argon_playwright_9router`)

| Parameter | Type | Required | Description |
| :--- | :--- | :--- | :--- |
| `prompt` | `string` | **Yes** | The coding task, architecture query, or debugging prompt. |
| `mode` | `string` | No | `playwright-first` (default), `9router-combo-first`, or `custom-model`. |
| `target_model` | `string` | No | Force a specific 9Router model or provider (e.g., `qoder/qwen3-coder-plus`, `ag/claude-sonnet-4-6`). |
| `system_prompt` | `string` | No | Custom system instruction for the model. |

---

## ⚠️ Disclaimer

This project is an unofficial community tool created for personal development and research purposes. Automating web interfaces via Playwright may be subject to the respective platform's Terms of Service. Never commit your `.9router-jio-playwright-profile` directory or `.env` credentials to public repositories.

---

## πŸ“„ License

MIT License β€” Free to use, modify, and distribute.

TDQS

B3.2/5.0

Scored across 1 tool

Disambiguation5/5

There is only one tool on the server, so there is nothing for an agent to confuse it with. Its purpose (proxying a prompt to a chosen provider/model) is stated explicitly.

Naming Consistency4/5

The single name uses snake_case and a clear verb ('ask_'), but it redundantly bakes in the server/bridge name and a provider ('argon_playwright_9router'), making it long and vendor-specific. With only one tool there is no cross-tool pattern to break.

Tool Count2/5

A router spanning many providers/models plus a Playwright web bridge is a lot of surface compressed into one opaque passthrough tool. There is no way to discover providers/models or check bridge health without invoking the single call.

Completeness2/5

The core 'send a prompt' operation exists, but the obvious lifecycle around it is missing: listing available providers/models/combos, checking bridge or session status, and any error/retry or cancellation path. Agents are left with a single fire-and-hope entry point.