Skip to main content
Glama
kaenozu

Browser AI Debate MCP

by kaenozu

Browser AI Debate MCP

A Model Context Protocol (MCP) server that runs a structured multi-round debate between ChatGPT Web and Gemini Web by operating both in the same Chrome browser via CDP (Chrome DevTools Protocol). No API keys, no external APIs, no OpenAI/Gemini SDKs — pure browser automation.

What It Does

  1. Opens ChatGPT Web and Gemini Web in the same Chrome browser session

  2. Sends the same question to both models independently (Phase 1)

  3. Makes each model critique the other's answer (Phase 2)

  4. Asks each to revise based on the critique (Phase 3)

  5. Asks ChatGPT (default) to integrate both into a final conclusion (Phase 4)

  6. Asks Gemini to audit the conclusion (Phase 4b)

  7. Returns a structured JSON result with confidence score, rationale, and per-provider status

Related MCP server: gemini-skill

Important

  • Operates by controlling a browser via CDP, not by calling APIs

  • Non-official: Uses the same approach as ChatGPT Web. UI changes can break selectors.

  • Requires a logged-in Chrome session for both ChatGPT and Gemini

  • No API keys needed — just a logged-in browser

  • Chrome profile is NOT stored in Git (.browser-ai-profile/ is gitignored)

  • Independent of chatgpt-web-url-mcp — this is a separate project

Prerequisites

  • Node.js 20+

  • Google Chrome (desktop)

  • Playwright (bundled with package)

Setup

git clone https://github.com/kaenozu/browser-ai-debate-mcp.git
cd browser-ai-debate-mcp
npm install
npm run build

Chrome Preparation

Log into ChatGPT and Gemini in your existing Chrome browser normally.

Option B: CDP connection to user-owned Chrome

  1. Open Chrome with remote debugging enabled:

    chrome://inspect/#remote-debugging
  2. Enable "Discover network targets"

  3. Set environment variable:

    set BROWSER_AI_CDP_URL=http://127.0.0.1:9222

Option C: Auto-launch dedicated Chrome

If no Chrome is running with CDP, the server can auto-launch a dedicated Chrome. The profile is stored in .browser-ai-profile/ (gitignored).

To pre-launch:

npm run login

This opens a new Chrome window. Log in, then close Chrome. The profile is saved.

Then for CDP mode:

npm run chrome:debug

MCP Client Configuration

{
  "mcpServers": {
    "browser-ai-debate": {
      "command": "node",
      "args": ["dist/index.js"],
      "env": {
        "BROWSER_AI_PROFILE_DIR": "C:/path/to/profile"
      }
    }
  }
}

browser_ai_debate Tool

Input

{
  "question": "Why is not swallowing exceptions important in TypeScript?",
  "context": "We have 70 source files and 23 with try-catch that swallows errors",
  "decisionCriteria": ["code reliability", "debuggability", "user experience", "maintainability"],
  "maxRounds": 3,
  "timeoutMs": 900000
}

Field

Required

Default

Description

question

Yes

The debate question (max 100,000 chars)

context

No

Additional context

decisionCriteria

No

Evaluation criteria (array of strings)

maxRounds

No

3

1-5, rounds beyond default will not run

timeoutMs

No

900000

Total timeout (min 30,000)

providerTimeoutMs

No

Per-provider timeout

includeTranscript

No

true

Include full conversation transcript

finalizer

No

"chatgpt"

Which provider makes the final decision

Output

{
  "status": "consensus",
  "conclusion": "...",
  "confidence": 0.85,
  "rationale": ["reason 1", "reason 2"],
  "agreements": [],
  "disagreements": [],
  "remainingRisks": [],
  "nextActions": [],
  "chatgptConversationUrl": "https://chatgpt.com/c/...",
  "geminiConversationUrl": "https://gemini.google.com/app/...",
  "providers": {
    "chatgpt": { "completed": true, "partial": false },
    "gemini": { "completed": true, "partial": false }
  },
  "rounds": [],
  "audit": {},
  "durationMs": 0
}

Status Values

  • consensus — Both models agree

  • decision — Clear recommendation made

  • disagreement — Models differ

  • partial — One or both providers incomplete/failed

  • failed — Both providers failed

Timeout and Partial Results

  • timeoutMs covers the entire debate, including queue wait time

  • Each provider has an individual timeout (default: total timeout / 4, max 120s per provider)

  • If one provider fails, the other's result is returned with status: "partial"

  • A partial result clearly indicates which provider failed and which succeeded

  • No result is hidden — partial is never treated as complete

Security Notes

  • Chrome profile is NOT committed to Git.browser-ai-profile/ is gitignored

  • No API keys are stored or used

  • No credentials are logged (URLs are redacted)

  • User-owned Chrome is never terminated

  • Auto-started Chrome (a dedicated profile) is cleaned up on shutdown

  • Conversation URLs and content are not logged externally

Troubleshooting

DOM selectors changed by UI update

ChatGPT or Gemini updated their web UI, causing selectors to fail.

Solutions:

  1. Clear .browser-ai-profile/ and re-login

  2. Use npm run chrome:debug with a fresh CDP connection

  3. File an issue with the specific page elements that changed

CDP connection fails

  1. Run npm run chrome:debug to start a dedicated Chrome with CDP

  2. Or ensure your user Chrome has remote debugging enabled

  3. Check that port 9222 is available

"AUTH_REQUIRED" error

The browser session has expired. Re-login to ChatGPT and/or Gemini, then retry.

Windows Execution

# Install
npm install
npm run build

# ChatGPT only
npm run inspector -- --prompt "TypeScript で例外を握りつぶさない設計が重要な理由を3点で説明してください"

# Full debate via MCP client
# See MCP configuration above

OpenCode MCP Registration

{
  "mcpServers": {
    "browser-ai-debate": {
      "command": "cmd",
      "args": ["/c", "node", "C:/path/to/browser-ai-debate-mcp/dist/index.js"],
      "env": {
        "BROWSER_AI_CDP_URL": "http://127.0.0.1:9222"
      }
    }
  }
}
Install Server
F
license - not found
A
quality
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/kaenozu/browser-ai-debate-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server