chatgpt-review-mcp

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.

Category
Visit Server

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:

  1. Memory (explicitly saved facts about you)
  2. 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 with powershell.exe -Command "netsh interface portproxy show all".
  • Get-NetTCPConnection ... 9222 shows 127.0.0.1:9222 — you are on an old Chrome that still binds IPv4; use a v4tov4 rule instead of v4tov6.
  • 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.

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