Browser AI Debate MCP

Browser AI Debate MCP

An MCP server that orchestrates structured multi-round debates between ChatGPT Web and Gemini Web in the same Chrome browser via CDP, requiring no API keys.

Category
Visit Server

README

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

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

Option A: Login to user-owned Chrome (recommended)

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"
      }
    }
  }
}

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured