Pull context from your AI browser tabs directly into Claude Code (and other AI coding tools) via MCP.
Claude Code / Copilot CLI / Codex CLI ← stdio (spawns server as subprocess)
OR
Cursor / Antigravity / Copilot (VS Code) ← HTTP http://127.0.0.1:27183/mcp
↕
Node MCP Server ←── WebSocket on localhost:27182
↕
Chrome Extension (background service worker)
↕
AI Chat Tabs (ChatGPT, Claude, Gemini, Grok, DeepSeek, Mistral, Perplexity)
You need two things: a Chrome extension and a small server program. Here's exactly what to do.
- Go to nodejs.org and download the LTS version
- Run the installer — click Next through everything, keep all defaults
- When it's done, open Terminal (Mac) or Command Prompt (Windows) and type:
You should see something like
node --versionv20.x.x. If so, you're good.
In Terminal / Command Prompt:
npm install -g @anthropic-ai/claude-codeThen run claude and follow the login prompt.
Copy and paste this one line into your terminal:
claude mcp add chatmcp -- npx -y chatmcp-serverThat's it. Claude Code will automatically start the server whenever you use it.
- Download or clone this repository — click the green Code button on GitHub, then Download ZIP, and unzip it somewhere on your computer
- Open Chrome and go to
chrome://extensionsin the address bar - In the top-right corner, turn on Developer mode
- Click Load unpacked
- Select the
chrome-extensionfolder from what you just unzipped - You should see the ChatMCP extension appear with an OFF badge
- Start Claude Code by typing
claudein your terminal - The extension badge should turn ON (green) within a few seconds
- Open any AI chat tab (ChatGPT, Gemini, etc.) in Chrome
- In Claude Code, ask: "pull context from my browser tabs"
Two modes: Tools that can spawn subprocesses use stdio (simpler — no background process needed). Tools that connect to a running server use HTTP mode — start the server once and leave it running.
claude mcp add chatmcp -- npx -y chatmcp-serverCopilot in VS Code (1.99+) spawns the server for you — no background process needed.
Workspace — create .vscode/mcp.json in your project:
{
"servers": {
"chatmcp": {
"command": "npx",
"args": ["-y", "chatmcp-server"]
}
}
}Global (all projects) — open VS Code, run MCP: Open User Configuration from the Command Palette, and add:
{
"servers": {
"chatmcp": {
"command": "npx",
"args": ["-y", "chatmcp-server"]
}
}
}Then open Copilot Chat, switch to Agent mode, and the chatmcp tools appear automatically. (MCP tools are invisible in Ask / Edit mode.)
Config lives at ~/.copilot/mcp-config.json (created automatically on first use). Add:
{
"mcpServers": {
"chatmcp": {
"type": "local",
"command": "npx",
"args": ["-y", "chatmcp-server"]
}
}
}Or use the interactive command inside the CLI:
/mcp add
Config lives at ~/.codex/config.toml. Add a section:
[mcp_servers.chatmcp]
command = "npx"
args = ["-y", "chatmcp-server"]Or scope it to a project by placing the same block in .codex/config.toml inside your repo.
You can also use the CLI helper:
codex mcp addProject-level — create .cursor/mcp.json in your project root:
{
"mcpServers": {
"chatmcp": {
"type": "stdio",
"command": "npx",
"args": ["-y", "chatmcp-server"]
}
}
}Global — add the same block to ~/.cursor/mcp.json.
Verify in Cursor Settings → Tools & MCP — you should see chatmcp with a green status indicator.
Open an Agent session, click ⋯ → MCP Servers → Manage MCP Servers → View raw config, and add to mcp_config.json:
{
"mcpServers": {
"chatmcp": {
"command": "npx",
"args": ["-y", "chatmcp-server"]
}
}
}Save the file — Antigravity picks up the new server immediately.
If your tool connects to MCP servers over HTTP/SSE rather than spawning subprocesses (OpenCode, Windsurf, custom agents, etc.), start the server in HTTP mode first:
npx -y chatmcp-server --httpThe server runs persistently on http://127.0.0.1:27183/mcp and accepts multiple simultaneous clients. Point your tool at that URL. Keep the terminal open (or add it to your system startup / launchd / systemd).
git clone https://github.com/indiantinker/chatMCP.git
cd chatMCP/mcp-server
npm install && npm run build
# stdio (Claude Code, Copilot, Codex, Cursor, Antigravity)
node /path/to/chatMCP/mcp-server/dist/index.js
# HTTP (OpenCode, Windsurf, or any HTTP MCP client)
node /path/to/chatMCP/mcp-server/dist/index.js --httpFor Claude Code with a local build:
claude mcp add chatmcp -- node /path/to/chatMCP/mcp-server/dist/index.js# See what AI chats are open
list_ai_tabs
# Pull the full conversation (auto-selects active AI tab)
get_chat_context
# Pull from a specific tab
get_chat_context tabId=12345
# Get a summary instead of the full transcript
get_chat_context summaryOnly=true
# Read any tab (docs, GitHub issues, articles)
get_page_content
# Check extension status
extension_status
Or just ask naturally:
"Pull context from my ChatGPT tab and continue building on that idea."
| Platform | URL |
|---|---|
| ChatGPT | chat.openai.com / chatgpt.com |
| Claude | claude.ai |
| Gemini | gemini.google.com |
| Grok | grok.com |
| DeepSeek | chat.deepseek.com |
| Mistral | chat.mistral.ai |
| Perplexity | perplexity.ai |
All data stays on your machine. The MCP server and Chrome extension communicate over localhost only — nothing is sent to any external server. Chat content is passed directly to your local Claude Code session.
- The MCP server starts automatically when Claude Code launches if registered (stdio mode).
- In HTTP mode, start the server manually and keep it running.
- The extension auto-reconnects every 3 seconds if the server restarts.
- Chat extraction uses DOM scraping — may need updates when AI platforms change their markup.
MIT — see LICENSE.
If this saves you time, buy me a coffee. ☕