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.
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
- Opens ChatGPT Web and Gemini Web in the same Chrome browser session
- Sends the same question to both models independently (Phase 1)
- Makes each model critique the other's answer (Phase 2)
- Asks each to revise based on the critique (Phase 3)
- Asks ChatGPT (default) to integrate both into a final conclusion (Phase 4)
- Asks Gemini to audit the conclusion (Phase 4b)
- 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
- Open Chrome with remote debugging enabled:
chrome://inspect/#remote-debugging - Enable "Discover network targets"
- 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 agreedecision— Clear recommendation madedisagreement— Models differpartial— One or both providers incomplete/failedfailed— Both providers failed
Timeout and Partial Results
timeoutMscovers 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:
- Clear
.browser-ai-profile/and re-login - Use
npm run chrome:debugwith a fresh CDP connection - File an issue with the specific page elements that changed
CDP connection fails
- Run
npm run chrome:debugto start a dedicated Chrome with CDP - Or ensure your user Chrome has remote debugging enabled
- 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"
}
}
}
}
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。