chatgpt-review-mcp
An MCP server that lets Claude Code send prompts to a logged-in ChatGPT web session via Chrome DevTools Protocol, enabling a second opinion from GPT without using API tokens.
README
chatgpt-review-mcp
A Model Context Protocol (MCP) server that lets Claude Code (or any MCP-compatible client) send prompts to your logged-in ChatGPT web session via Chrome DevTools Protocol. Use it to get a second opinion from GPT without consuming Anthropic tokens or OpenAI API quota — the request goes through your normal browser session using whichever model you have selected in the ChatGPT UI.
Runs on WSL2 (Ubuntu) + Windows Chrome. Adapting it to other setups is straightforward but not covered here.
Architecture
Claude Code (WSL)
└─► MCP stdio ──► mcp_server.py (WSL)
└─► playwright.connect_over_cdp ──► 172.26.80.1:9222
│
(netsh portproxy)
▼
Chrome CDP on ::1:9222
│
chatgpt.com tab (logged in)
The MCP process runs in WSL. It reuses the Windows Chrome instance you have logged into ChatGPT — no headless browser, no API keys, no scraping-detection fights.
Prerequisites
- Windows 10/11 with WSL2 Ubuntu
- Chrome installed at
C:\Program Files\Google\Chrome\Application\chrome.exe - A paid or free ChatGPT account with a session that stays logged in
- Python 3.10+ inside WSL
Setup
1. Windows-side: launch a dedicated CDP Chrome
Use a separate profile so the CDP Chrome does not conflict with your daily Chrome. From WSL:
bash start-chrome.sh
This runs powershell.exe Start-Process chrome.exe --remote-debugging-port=9222 --user-data-dir=C:\chrome-cdp-profile https://chatgpt.com and opens a fresh Chrome window. Log in to ChatGPT once — the profile will remember it.
2. Windows-side: port forwarding for WSL access
Chrome 149+ only binds ::1:9222 (IPv6 loopback), so WSL cannot reach it directly through the 172.26.80.1 gateway. Fix with one command in administrator PowerShell:
netsh interface portproxy add v4tov6 listenaddress=0.0.0.0 listenport=9222 connectaddress=::1 connectport=9222
Optionally allow the port through Windows Firewall:
New-NetFirewallRule -DisplayName "Chrome CDP 9222 (WSL)" -Direction Inbound -Protocol TCP -LocalPort 9222 -Action Allow -Profile Any
To remove later: netsh interface portproxy delete v4tov4 listenaddress=0.0.0.0 listenport=9222
3. WSL-side: Python dependencies
cd chatgpt-review-mcp
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
playwright is used only for CDP connection — you do not need to run playwright install, no local browsers are downloaded.
4. Verify connectivity
python test_connect.py
Expected output includes Chrome: Chrome/..., the list of open tabs, and [✓] 找到 ChatGPT 页面. If it times out, the portproxy in step 2 is usually the culprit.
5. Register with Claude Code
claude mcp add --scope user chatgpt-review -- \
/absolute/path/to/chatgpt-review-mcp/.venv/bin/python \
/absolute/path/to/chatgpt-review-mcp/mcp_server.py
Restart Claude Code, then claude mcp list should show chatgpt-review: ... - ✓ Connected.
Usage
Once registered, ask Claude Code something like:
- "让 ChatGPT 审一下这个方案:..."
- "Get a second opinion from GPT on this design"
- "用 review_with_chatgpt 帮我看看这段代码"
The review_with_chatgpt tool takes:
| Arg | Type | Default | Meaning |
|---|---|---|---|
prompt |
str | — | Message to send to ChatGPT (include enough context — GPT does not see your Claude Code conversation) |
wait_timeout |
int | 180 | Max seconds to wait for the reply to finish streaming |
new_chat |
bool | False | If True, open a fresh conversation so there is no prior turn history |
Making new_chat=True truly context-free
ChatGPT has two other memory sources besides the current conversation:
- Memory (explicitly saved facts about you)
- Reference chat history (implicit recall of your other conversations)
Both default on. For a strict "independent reviewer with no context" setup, disable both in ChatGPT: profile picture → Settings → Personalization → toggle off Memory and Reference chat history.
Command-line use
chatgpt_client.py also works standalone:
python chatgpt_client.py "explain LogSumExp in one sentence"
Troubleshooting
HTTP 探针失败: timed out— Windows Firewall or the portproxy rule is not in place. Confirm withpowershell.exe -Command "netsh interface portproxy show all".Get-NetTCPConnection ... 9222shows127.0.0.1:9222— you are on an old Chrome that still binds IPv4; use av4tov4rule instead ofv4tov6.- MCP returns
"Retry"— happens if a previous ChatGPT generation was interrupted and the page still shows a Retry button. The client now polls for text stability and filters this out; if you still hit it, refresh the ChatGPT tab manually. - Selectors break — ChatGPT occasionally changes its DOM. Update the constants at the top of
chatgpt_client.py:INPUT_SELECTORS,STOP_BUTTON_SELECTORS,ASSISTANT_MSG_SELECTOR.
Files
| File | Purpose |
|---|---|
chatgpt_client.py |
Core CDP + playwright logic; ask_chatgpt() async entry point |
mcp_server.py |
FastMCP wrapper exposing review_with_chatgpt tool |
test_connect.py |
Diagnostic script for the CDP handshake |
start-chrome.sh |
Launch CDP Chrome from WSL (recommended) |
start-chrome.bat |
Same, as a double-clickable batch file |
requirements.txt |
mcp, playwright, httpx |
License
MIT.
推荐服务器
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 模型以安全和受控的方式获取实时的网络信息。