Browser AI Debate MCP
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 Chrome via CDP (Chrome DevTools Protocol). It uses browser automation rather than provider APIs.
What It Does
Opens ChatGPT Web and Gemini Web in the same Chrome session
Sends the same question to both models independently
Makes each model critique the other response
Requests revised answers
Produces a final conclusion and an independent audit
Returns structured results with confidence, rationale, risks, and provider status
Important
Requires logged-in ChatGPT and Gemini browser sessions
Uses browser UI automation, so provider UI changes can break selectors
Does not require OpenAI or Gemini API keys
Stores the dedicated profile only in
.browser-ai-profile/, which is gitignoredDoes not terminate a user-owned Chrome process
Prerequisites
Node.js 20 or newer
Google Chrome desktop
Setup
git clone https://github.com/kaenozu/browser-ai-debate-mcp.git
cd browser-ai-debate-mcp
npm install
npm run buildChrome Preparation
Auto-launch
When BROWSER_AI_CDP_URL is not set, the server attempts to launch a dedicated Chrome profile automatically.
npm startConnect to an existing logged-in Chrome
Log into ChatGPT and Gemini in Chrome.
Enable remote debugging at
chrome://inspect/#remote-debugging.Configure the CDP endpoint before starting the server.
Windows Command Prompt:
set BROWSER_AI_CDP_URL=http://127.0.0.1:9222
npm startPowerShell:
$env:BROWSER_AI_CDP_URL = "http://127.0.0.1:9222"
npm startPre-launch a dedicated profile
npm run loginLog into both services, close Chrome, then run:
npm run chrome:debugStart the MCP server in another terminal:
npm startMCP Client Configuration
The public server identifier remains browser-ai-debate, and the public tool name remains browser_ai_debate for compatibility.
Auto-launch configuration:
{
"mcpServers": {
"browser-ai-debate": {
"command": "node",
"args": ["dist/index.js"]
}
}
}Existing Chrome via CDP:
{
"mcpServers": {
"browser-ai-debate": {
"command": "node",
"args": ["dist/index.js"],
"env": {
"BROWSER_AI_CDP_URL": "http://127.0.0.1:9222"
}
}
}
}browser_ai_debate Tool
Example input:
{
"question": "Why is not swallowing exceptions important in TypeScript?",
"context": "We have 70 source files and 23 try-catch blocks that swallow errors",
"decisionCriteria": ["reliability", "debuggability", "user experience", "maintainability"],
"maxRounds": 3,
"timeoutMs": 900000
}Field | Required | Default | Description |
| Yes | — | Debate question, up to 100,000 characters |
| No | — | Additional context |
| No | — | Evaluation criteria |
| No | 3 | Maximum 1–5 rounds |
| No | 900000 | Total timeout, minimum 30,000 ms |
| No | derived | Per-provider timeout |
| No | true | Include the transcript |
| No |
| Provider that produces the final decision |
Timeout and Partial Results
timeoutMscovers queue wait time and all debate phasesProvider failures are returned explicitly
If only one provider completes, the result is marked
partialPartial output is never presented as a complete result
Security Notes
Browser profiles and credentials are not committed to Git
Conversation content is not sent to an additional external service by this MCP server
User-owned Chrome is not terminated by the server
Dedicated Chrome processes started by the server are cleaned up on shutdown
Troubleshooting
CDP connection fails
Confirm Chrome remote debugging is enabled.
Confirm
BROWSER_AI_CDP_URLpoints to the active endpoint.Check that port 9222 is available and reachable.
Run
npm run chrome:debugto start the dedicated profile explicitly.Open
http://127.0.0.1:9222/json/versionlocally to confirm the endpoint responds.
AUTH_REQUIRED
The stored browser session has expired or is not logged into one of the providers.
Run
npm run login.Log into ChatGPT and Gemini.
Close the profile window and retry.
Provider UI or DOM selectors changed
Authentication succeeds, but the provider page no longer matches the expected UI.
Retry with a fresh dedicated profile.
Confirm the provider page works manually.
Report the provider, page state, and observed error without including credentials or private conversation content.
Update only the provider selector module (
src/providers/<provider>/selectors.ts) and its sanitized fixture test (tests/provider-selector-smoke.test.ts). Keep fixtures free of real conversation content.Run
npm testandnpm run checkbefore opening a PR.
The normal CI suite runs the sanitized DOM fixture and fallback-order tests. The opt-in .github/workflows/live-smoke.yml is manual-only, checks out master, requires the protected provider-live-smoke environment, and reads only BROWSER_AI_CDP_URL from secrets. It must never be enabled for pull requests or execute untrusted PR code. Live smoke requires logged-in ChatGPT and Gemini tabs in the operator's CDP session; those checks are intentionally an external gate.
Auto-launch cannot find Chrome
Confirm Chrome is installed in a standard location, or use an explicit CDP connection with BROWSER_AI_CDP_URL.
Windows Quick Start
start.batManual start:
npm run build
npm startInteractive MCP inspection:
npm run inspectorOpenCode MCP Registration
Existing logged-in Chrome:
{
"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"
}
}
}
}For dedicated auto-launch mode, omit the env block.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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