WebChatMCP.js
Integrates with ChatGPT's web interface via a built-in persistent browser. It enables sending prompts through temporary (incognito) chats, retrieving ChatGPT's answers as tool results, listing available models, and managing login/status for the ChatGPT account.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@WebChatMCP.jsask ChatGPT to explain quantum entanglement in simple terms"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
WebChatMCP.js
Website: https://webchatmcp.js-package.xyz · Source: https://github.com/JS-PACKAGE/WebChatMCP.js · License: Apache-2.0
An MCP server with a built-in browser. Log into ChatGPT once in the visible browser; afterwards every call sends your prompt through a ChatGPT temporary (incognito) chat and returns the answer — nothing is written to the account's chat history.
English
What is it?
WebChatMCP.js is a local MCP (Model Context Protocol) server. It embeds a persistent Chromium browser (Playwright) so an MCP client can drive ChatGPT's web interface: one manual login, then prompts flow through temporary chats and answers come back as tool results.
Features
Built-in browser with persistent profile — the ChatGPT login survives restarts.
Every
webchat_askopens a brand-new temporary (incognito) chat: no history, not used for training.The answer text is captured from ChatGPT's own response bubble and returned to the MCP client.
webchat_modelslists the models your account can use (live from the model switcher);webchat_askcan switch per prompt.Honest state probing: login and temporary-chat detection return
true / false / unknown, never guesses.Clear error codes (
logged_out,composer_not_found,no_response, …) instead of silent failures.
Requirements
Node.js ≥ 22
A ChatGPT account (free or paid)
First-run login needs a visible display (no headless login)
Install
git clone https://github.com/JS-PACKAGE/WebChatMCP.js.git
cd WebChatMCP.js
npm install
npx playwright install chromium # one-time: the built-in browser
npm run buildMCP client configuration
{
"mcpServers": {
"webchatmcp": {
"command": "node",
"args": ["/absolute/path/to/WebChatMCP.js/dist/WebChatMCP.js"]
}
}
}Or connect directly over HTTP (Streamable HTTP) — no child process needed:
http://127.0.0.1:8321/mcpBoth transports run at the same time. The port is written in src/config.ts (SERVER.httpPort, default 8321) and can be overridden with WEBCHATMCP_PORT; WEBCHATMCP_HOST=0.0.0.0 exposes it to the LAN (0 disables HTTP).
First run
Call
webchat_login— a browser window opens at ChatGPT. Log in manually.Wait for the tool to report
loggedIn: true(or callwebchat_statuslater).Call
webchat_askwith your prompt; the answer text comes back as the tool result.
Tools
Tool | Input | Output |
|
| login status JSON |
|
| ChatGPT's answer text |
| — | available model list JSON ( |
| — | browser / login / temporary-chat state JSON |
| — | close the built-in browser (login stays saved) |
Environment variables
Variable | Meaning |
| Browser profile directory (default |
|
|
|
|
| Answer wait limit (default |
| HTTP port (default |
| HTTP bind address (default |
Notes
Cloudflare may challenge fresh automated browsers. The default visible mode lets you (or the challenge) pass manually; headless mode is not recommended for first login.
The HTTP endpoint has no authentication. It binds to
127.0.0.1by default; exposing it (0.0.0.0) lets anyone on your network drive your ChatGPT session — only do this on trusted networks.The server never reads or stores passwords, cookies or tokens itself — login happens only through your own manual typing in the browser.
Prompts and answers pass through ChatGPT's service: OpenAI's data usage policies apply.
Related MCP server: chatgpt-webui-mcp
繁體中文
這是什麼?
WebChatMCP.js 是本機 MCP(Model Context Protocol)伺服器。它內建持久化的 Chromium 瀏覽器(Playwright),讓 MCP 用戶端可以操作 ChatGPT 網頁介面:人工登入一次,之後每次呼叫把提示送進臨時(無痕)聊天,回覆以工具結果回傳。
功能
內建瀏覽器+持久化 profile——ChatGPT 登入狀態重啟不失效。
每次
webchat_ask都開啟全新的臨時聊天:不寫入帳號聊天紀錄、不用於模型訓練。回覆文字直接擷取自 ChatGPT 的回應氣泡,回傳給 MCP 用戶端。
webchat_models即時列出帳號可用模型(擷取自模型選單);webchat_ask可逐題指定模型。誠實探測:登入與臨時聊天判定回
true / false / unknown,絕不猜測。明確錯誤碼(
logged_out、composer_not_found、no_response等),不靜默失敗。
需求
Node.js ≥ 22
ChatGPT 帳號(免費或付費)
首次登入需要可視畫面(不支援無頭登入)
安裝
git clone https://github.com/JS-PACKAGE/WebChatMCP.js.git
cd WebChatMCP.js
npm install
npx playwright install chromium # 首次:安裝內建瀏覽器
npm run buildMCP 用戶端設定
{
"mcpServers": {
"webchatmcp": {
"command": "node",
"args": ["/absolute/path/to/WebChatMCP.js/dist/WebChatMCP.js"]
}
}
}或以 HTTP 直連(Streamable HTTP),不必啟動子程序:
http://127.0.0.1:8321/mcp兩種連線同時啟用。port 寫在 src/config.ts(SERVER.httpPort,預設 8321),可用 WEBCHATMCP_PORT 覆蓋;WEBCHATMCP_HOST=0.0.0.0 開放區網(0 停用 HTTP)。
首次使用
呼叫
webchat_login——瀏覽器視窗開啟 ChatGPT,人工完成登入。工具回報
loggedIn: true即完成(之後可隨時用webchat_status確認)。呼叫
webchat_ask送出提示,回覆文字即為工具結果。
工具
工具 | 輸入 | 輸出 |
|
| 登入狀態 JSON |
|
| ChatGPT 回覆文字 |
| — | 可用模型清單 JSON( |
| — | 瀏覽器/登入/臨時聊天狀態 JSON |
| — | 關閉內建瀏覽器(登入狀態保留) |
環境變數
變數 | 意義 |
| 瀏覽器 profile 目錄(預設 |
|
|
| 設 |
| 等待回覆上限(預設 |
| HTTP port(預設 |
| HTTP 監聽位址(預設 |
注意事項
Cloudflare 可能對全新自動化瀏覽器出驗證頁;預設可視模式可人工通過,首次登入不建議無頭。
HTTP endpoint 無任何認證,預設只綁
127.0.0.1;開放(0.0.0.0)等同讓同網路任何人操作你的 ChatGPT 會話,只建議在可信網路上使用。伺服器本身不讀、不存任何密碼、cookie 或 token——登入只透過你自己在瀏覽器中操作。
提示與回覆會經過 ChatGPT 服務,適用 OpenAI 的資料使用政策。
日本語
これは何?
WebChatMCP.js はローカルの MCP(Model Context Protocol)サーバーです。永続化された Chromium ブラウザ(Playwright)を内蔵し、MCP クライアントから ChatGPT の Web 画面を操作します。手動ログインは一度だけ、以降の呼び出しはすべて**一時チャット(シークレット)**にプロンプトを送り、回答をツール結果として返します。
機能
内蔵ブラウザ+永続プロファイル——ChatGPT のログインは再起動後も保持。
webchat_askのたびに新しい一時チャットを開く:履歴に残らず、学習にも使われません。回答テキストは ChatGPT の応答バブルから直接取得して返却。
webchat_modelsでアカウントで使えるモデルを一覧化(モデルスイッチャーから取得);webchat_askでプロンプトごとにモデル指定が可能。正直な状態判定:ログイン/一時チャットの検出は
true / false / unknown、推測しません。明確なエラーコード(
logged_out、composer_not_found、no_responseなど)。
要件
Node.js ≥ 22
ChatGPT アカウント(無料/有料)
初回ログインには表示可能な画面が必要(ヘッドレス非対応)
インストール
git clone https://github.com/JS-PACKAGE/WebChatMCP.js.git
cd WebChatMCP.js
npm install
npx playwright install chromium # 初回のみ
npm run buildMCP クライアント設定
{
"mcpServers": {
"webchatmcp": {
"command": "node",
"args": ["/absolute/path/to/WebChatMCP.js/dist/WebChatMCP.js"]
}
}
}または HTTP で直接接続(Streamable HTTP)——子プロセス不要:
http://127.0.0.1:8321/mcp両方の接続を同時に有効化。ポートは src/config.ts(SERVER.httpPort、既定 8321)に記載され、WEBCHATMCP_PORT で上書き可能;WEBCHATMCP_HOST=0.0.0.0 で LAN に開放(0 で HTTP 無効化)。
初回の流れ
webchat_loginを呼ぶ——ブラウザが ChatGPT を開くので手動でログイン。ツールが
loggedIn: trueを返したら完了(webchat_statusでいつでも確認可能)。webchat_askでプロンプトを送り、回答テキストを受け取る。
ツール
ツール | 入力 | 出力 |
|
| ログイン状態 JSON |
|
| ChatGPT の回答テキスト |
| — | 利用可能モデル一覧 JSON( |
| — | ブラウザ/ログイン/一時チャット状態 JSON |
| — | 内蔵ブラウザを終了(ログインは保持) |
環境変数
変数 | 意味 |
| ブラウザプロファイルの場所(既定 |
|
|
|
|
| 回答待ち上限(既定 |
| HTTP ポート(既定 |
| HTTP バインド先(既定 |
注意
新規の自動化ブラウザには Cloudflare の検証がかかることがあります。既定の表示モードなら手動で通過でき、初回ログインにヘッドレスは非推奨です。
サーバー自体はパスワード・Cookie・トークンを読み書きしません。ログインは必ずご自身の手動操作によるものです。
プロンプトと回答は ChatGPT のサービスを経由します(OpenAI のデータポリシーが適用されます)。
This server cannot be deployed
Maintenance
Related MCP Connectors
Stealth web browser for agents: search, fetch, click, download and type in persistent MCP sessions.
Browser MCP for logged-in tasks. Uses your Chrome — credentials stay local. Zero-token replay.
Remote streamable-HTTP MCP server running on a single Cloudflare Worker. Your assistant gets live Airbnb, Amazon, Booking.com, Google Flights, Maps and Reddit data, social search on X, Instagram and TikTok, the Meta Ad Library, and image/video generation without any keys. Connect your own accounts to let it send WhatsApp or Telegram messages, work an IMAP inbox, manage Meta Ads campaigns and publish to X and LinkedIn. OAuth 2.1 with PKCE; stored credentials are AES-256-GCM encrypted.
Hyperbrowser MCP — wraps the Hyperbrowser AI-agent browsing API
Related MCP Servers
- AlicenseAqualityBmaintenanceConnects MCP clients to real browser sessions via a Chromium plugin, enabling LLMs to read, scan, automate, and navigate web pages using the user's existing browser state.10106 PyPI303MIT
- AlicenseBqualityFmaintenanceMCP server that drives chatgpt.com via web UI automation using a session token, enabling long-running tasks, deep research, and image generation.970 npm2MIT
- AlicenseAqualityCmaintenanceMCP server that drives chat.sakana.ai via headless Chrome with persistent sessions. Enables AI assistants to interact with Sakana AI chat through tools like session management, with ToS gate and browser automation.549 npmMIT
- AlicenseNot gradedqualityBmaintenanceMCP server that turns one authenticated ChatGPT browser page into a bounded MCP server, exposing tools for creating, listing, searching, exporting, sending, editing chats and downloading media via a CDP driver.MIT