WebChatMCP.js MCP server
Commit Oct 14, 2026An MCP server with a built-in browser that sends prompts through private or temporary chats on ChatGPT, Claude, Grok, and Gemini.
Also known as JS-PACKAGE/WebChatMCP.js, webchatmcp-js
- Stars
- 3
- Tools
- 8
- Downloads, 30 days
- —
- Latest version
- —
- Last commit
- Oct 14, 2026
- License
- Apache-2.0
What is WebChatMCP.js MCP?
WebChatMCP.js is an MCP server with a built-in browser that sends prompts through private or temporary chats on ChatGPT, Claude, Grok, and Gemini. It exposes 8 tools, such as webchat_login, webchat_logout, webchat_ask.
Summary generated from the project's README
About WebChatMCP.js MCP server
Interacting with web-based AI interfaces through private sessions is what WebChatMCP.js enables for developers using MCP clients. This local server embeds a persistent Chromium browser via Playwright to drive the web interfaces of ChatGPT, Claude, Grok, and Gemini. It allows an AI client to send prompts through temporary or private chats so that responses are returned as tool results without being saved to the account's chat history.
Users can operate the server in headless mode or view a window for manual logins. While ChatGPT and Gemini support guest access, Claude and Grok require a login. The server manages persistent profiles so that logins survive restarts. It includes specialized tools like webchat_ask to send prompts, webchat_models to retrieve available models and thinking depth settings, and webchat_warmup to preload private chat pages for faster subsequent requests.
Setup requires Node.js version 22 or higher. The server can be run as a local stdio process or as a background service accessible over HTTP on port 8321. It provides clear error codes for issues like logged_out or no_response to ensure reliable tool execution.
What you can do with it
- 1Querying AI models privatelySend a prompt to a specific provider using a temporary chat session to avoid saving it to history.
- 2Managing model configurationsRetrieve a list of available models and their specific thinking depth settings for a provider.
- 3Automating browser loginsTrigger a manual login window only when an account session is required or expired.
- 4Reducing prompt latencyPreload the private chat interface of a service to skip page loading during agent loops.
Written from the project's README. Every use case is checked against a quote from it.
WebChatMCP.js MCP tools 8
Detected from the READMEwebchat_loginwebchat_logoutwebchat_askwebchat_modelswebchat_statuswebchat_closewebchat_warmupwebchat_release
Automated checks
Ran Nov 14, 2026Full report →Not verified yet. A server needs a score of 80, no serious finding, and enough data for us to check. How checks work · What to fix for more points
- Source repository linked and reachablejs-package/webchatmcp.js is public and reachablegithub.com/js-package/webchatmcp.js ↗Pass
- Package names this repository as its sourceNot checked
- Build provenance (Sigstore attestation)Not checked
- Open source license (OSI)Apache-2.0spdx.org/licenses/Apache-2.0.html ↗Pass
- Commit or release in the last yearLast commit or release 2026-10-14github.com/js-package/webchatmcp.js ↗Pass
- OpenSSF ScorecardNot checked
- Package name not close to a popular packageNot checked
- No critical advisory in the package or its dependenciesNot checked
- No hidden instructions to the model8 tool descriptions and the README read; no override phrases, credential paths or hidden charactersPass
- Destructive tools are labelledNo tool named like delete, drop or execPass
- Remote endpoint answers the MCP handshakeNot checked
README
View on GitHubWebChatMCP.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. It sends your prompt through the private / temporary chat of ChatGPT, Claude, Grok or Gemini and returns the answer — nothing is written to the account's chat history. Logging in is optional for ChatGPT and Gemini (they also work as a guest); Claude and Grok need a login.
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 the web interface of ChatGPT, Claude, Grok and Gemini: prompts flow through private chats and answers come back as tool results. Every tool except webchat_close and webchat_release takes a provider (chatgpt default, claude, grok, gemini).
Features
-
Built-in browser with persistent profile — logins survive restarts; one profile holds all four services.
-
Works without logging in on ChatGPT and Gemini (guest). Claude and Grok require a login (a Grok guest is asked to sign up after sending and gets
logged_out). -
Every
webchat_askopens a brand-new chat and attempts the service's private mode:Service How the private chat is entered ChatGPT https://chatgpt.com/?temporary-chat=trueClaude https://claude.ai/new?incognito=Grok https://grok.com/c#privateGemini https://gemini.google.com/app, then the Temporary chat button is clicked (the URL cannot enter it directly; guests have no such button)Guest use or unconfirmed private mode is noted in the result; Gemini guests have no temporary-chat button. Data retention and training policies are determined by the chosen service, not guaranteed by this server.
-
The answer text is captured from the service's own response bubble and returned to the MCP client.
-
webchat_modelslists the models and the thinking depth (ChatGPT slider, Claude effort, Gemini extended thinking) of your account, live from the menus;webchat_askcan switch the model (model) and then the thinking depth (thinking) per prompt, using the labels fromwebchat_models. -
webchat_logoutsigns out without showing any window;webchat_loginchecks first and only shows a window when a manual login is really needed. -
Honest state probing: login and private-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
- Optional: an account on the service you want to use (required for Claude and Grok)
- The browser is headless by default; a window only appears when a manual login (or a Cloudflare / age check) needs you
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 build
Automatic install, background service and update (scripts)
The scripts in script/ set up Node.js (if it is missing or older than 22, an official build is downloaded to ~/.webchatmcp/node and its SHA-256 is verified), the dependencies and the built-in browser, build the project, then register and start it as a background service. No administrator rights needed.
| OS | Script | Background mechanism |
|---|---|---|
| macOS | script/install.sh |
launchd LaunchAgent (starts at login, restarts on crash) |
| Linux | script/install.sh |
systemd --user (falls back to nohup) |
| Windows | script/install.ps1 |
Task Scheduler (starts at logon, hidden window, restarts on failure) |
Remote one-line install (installs git and Node.js if missing, git clones the source into ~/.webchatmcp/app (Windows: %USERPROFILE%\.webchatmcp\app), then installs and starts the service):
# macOS / Linux
curl -fsSL https://webchatmcp.js-package.xyz/script/install.sh | bash
curl -fsSL https://webchatmcp.js-package.xyz/script/install.sh | bash -s -- update # update
# Windows (PowerShell)
& ([scriptblock]::Create((irm https://webchatmcp.js-package.xyz/script/install.ps1).TrimStart([char]0xFEFF))) # install
& ([scriptblock]::Create((irm https://webchatmcp.js-package.xyz/script/install.ps1).TrimStart([char]0xFEFF))) update # update
Missing git is installed with Homebrew on macOS (or by triggering the Command Line Tools installer), with the package manager on Linux (needs sudo unless root), and as MinGit under %USERPROFILE%\.webchatmcp\git on Windows (SHA-256 verified). Or clone the repository yourself and run the scripts from inside it:
# macOS / Linux
git clone https://github.com/JS-PACKAGE/WebChatMCP.js.git && cd WebChatMCP.js
script/install.sh # install and start (default action: install)
script/install.sh update # update: stops the running service → git pull → rebuild → restart
script/install.sh status # status (also: start / stop / restart / logs / uninstall)
# Windows (PowerShell)
git clone https://github.com/JS-PACKAGE/WebChatMCP.js.git; cd WebChatMCP.js
powershell -ExecutionPolicy Bypass -File script\install.ps1 # install and start
powershell -ExecutionPolicy Bypass -File script\install.ps1 update # update (same as above)
powershell -ExecutionPolicy Bypass -File script\install.ps1 status # also: start / stop / restart / logs / uninstall
- Update first runs
git fetchand does nothing when you are already up to date (--force/-Forcerebuilds anyway). Otherwise it stops the running service and any leftoverWebChatMCP.jsprocesses (including instances an MCP client started over stdio), updates, then starts the service again. It aborts if the working tree has uncommitted changes. - The service is reached over HTTP:
http://127.0.0.1:8321/mcp. Put environment variables in~/.webchatmcp/webchatmcp.env(Windows:%USERPROFILE%\.webchatmcp\webchatmcp.env) asKEY=VALUElines, thenrestart. - The service and a stdio instance share one browser profile — pick one connection style.
- Self-start: after install the service starts automatically at login (on Linux also at boot without a login when linger is enabled) and restarts if it crashes;
statusshows the auto-start state. macOS uses a LaunchAgent, Linuxsystemd --user(crontab@rebootin thenohupfallback), Windows Task Scheduler (at logon). - Uninstall:
script/uninstall.sh(Windows:script\uninstall.ps1) stops the running service, then removes the service registration and its autostart setup (launchd plist / systemd unit / crontab@reboot/ scheduled task, plus linger if the script enabled it). The source, the logged-in profile and the env file are kept by default (--purge/-Purgealso removes Node.js, git, logs, the env file and the source downloaded by a remote install;--purge-profile/-PurgeProfilealso deletes the profile). - If the browser cannot start on Linux, run
npx playwright install-deps chromiumas root. The Windows script has not been verified on a real Windows machine.
MCP 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/mcp
Both 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
- Guest use needs no setup: call
webchat_askwith your prompt (providerdefaults tochatgpt). - To use your account (or Claude / Grok): call
webchat_loginwith theprovider. If you are already logged in, it returns immediately and shows no window; otherwise a window opens, you log in manually, and it is hidden again. - To sign out: call
webchat_logout(no window).
If login opens a new tab, the server follows it. Fast replies are captured even when they appear immediately on send. Grok asks you to confirm your age once; the server never fills that in for you — run webchat_login with provider=grok and answer it in the window. After updating or rebuilding, restart the MCP server to load the new code (the saved profile is retained).
Tools
Every tool except webchat_close and webchat_release accepts provider? (chatgpt | claude | grok | gemini, default chatgpt; webchat_status defaults to the service of the current page).
| Tool | Input | Output |
|---|---|---|
webchat_login |
provider?, timeout_seconds? |
login status JSON (alreadyLoggedIn) |
webchat_logout |
provider? |
JSON: cleared domains and the login state afterwards |
webchat_ask |
provider?, prompt, model?, thinking?, timeout_seconds? |
the answer text (a note is appended for guest use or unconfirmed private mode) |
webchat_models |
provider? |
JSON: models and thinking lists (label, current) |
webchat_status |
provider? |
browser / login / private-chat state JSON, plus cdp.enabled / cdp.endpoint |
webchat_close |
— | close the built-in browser (logins stay saved) |
webchat_warmup |
provider?, model? |
preload the service's private chat page, and select model ahead of time (for host integrations) |
webchat_release |
— | close the background browser when no webchat model is in use |
As soon as a question's prompt is sent, the server loads the next private chat page — with the same model/thinking — in a separate background tab while the answer is still generating, so the next question (typically the next round of an agent tool loop) skips the page load and model selection. webchat_warmup preloads a service's page ahead of the first question. The Oh My Pi and Pi plugins call it for you: switching to a webchat model preloads that service's page, and switching away to another model (or quitting) calls webchat_release to close the browser. Hosts that send no such signal (the Codex, Claude, Grok and Hermes bridges, plain MCP clients) rely on the idle timeout instead: the headless browser is closed 600 seconds after the last call and restarts on the next question (set WEBCHATMCP_IDLE_CLOSE_SECONDS; 0 disables it). A visible browser window (login in progress, WEBCHATMCP_HEADLESS=0) is never closed or preloaded automatically.
This parallel preload starts only when no other browser operation is queued (otherwise it is scheduled after the answer) and never delays the current answer; the answered tab is closed when that question finishes. A new browser operation cancels an unfinished preload and closes its separate tab, but a compatible next question or same-setting webchat_warmup takes over the page already loading; cancelling a question also cancels its unfinished preload. Repeated warmup preserves an unused, valid page instead of navigating again; each question still consumes a fresh private chat exactly once. Preloading also supports thinking without model, and reapplies thinking after a model change when needed. Navigation continues when the composer or login button appears; response completion retains the original stability checks.
Cancellation: when an MCP client sends notifications/cancelled, a bridge connection drops, or Oh My Pi / Pi aborts a reply, the server stops that question at the next safe point: nothing is typed or sent if the prompt was not sent yet; otherwise it makes a best-effort attempt to press the page's stop button, then releases the browser lock. Navigation or clicks already underway finish before cancellation is observed. On services that require a login (Claude, Grok), a guest send that gets no reply within 15 seconds while still logged out returns logged_out without waiting for the full timeout.
Performance: response extraction and previous text stay in the browser; unchanged samples send a marker and appended text sends only the new tail. Generation waits for the stop button rather than repeatedly transferring the full answer. Equal-length rewrites are still detected, and completion thresholds are unchanged. Model-menu labels and checked states are read in batches; Gemini waits on its actual gem-menu surface instead of timing out on a missing role="menu". Private-mode checks no longer read the whole page text on services without private-mode indicator words (Claude, Gemini). Already-current selections avoid unnecessary clicks. Menu-settling and reply-stability safeguards remain.
All six host plugins assemble complete context without automatic length caps: system instructions (also without tools), environment/reminders, conversation, tool definitions including $schema, and tool results retain their content and indentation. The former 200,000-character budget and old-turn/result truncation are removed; Codex response objects retain complete supported tool declarations. Long conversations can therefore transfer more data or reach the website's own input limit; the bridge does not silently shorten them. A serial tool request containing multiple calls is rejected rather than dropping calls; a named tool_choice applies to every call.
Oh My Pi/Pi deliver a complete matching MCP SSE result without waiting for connection EOF, decoding fragmented frames without repeatedly rescanning the accumulated result. Browser UA and parsed model-file caches, single-chunk copy avoidance, asynchronous decompression and backpressure-aware forwarding remain. A same-setting preload is reused only while valid and unused. This is not token streaming: hosts still receive text after the whole web reply is stable and its tool envelope is validated. Heartbeats/start events are not first-answer-text; emitting unvalidated partial JSON or text that the page may rewrite would weaken correctness.
The HTTP server closes the connection after every response (Connection: close, including bridge and MCP SSE responses). Node's built-in fetch (undici 8.9 in Node 26.7) defers a request on a reused idle keep-alive connection to an unref'd setImmediate check; when the client has nothing else to do, that check runs only when its next timer fires (usually undici's ~0.5 s low-resolution timer). Against the real server, sequential requests reusing a connection were measured at a median of 0.44–0.47 s each, sometimes several seconds; with the connection closed they take 1.5–5 ms. Clients that already reuse connections efficiently (e.g. Python's http.client) pay roughly 0.75 ms more per request.
Plugins (plugins/)
A single JSON file adds another chat service. Put it in plugins/ or in the user directory ~/.webchatmcp/plugins/; it is loaded at startup and joins the provider option of service-specific tools (webchat_close and webchat_release have no provider; files whose name starts with _ are templates and are not loaded). A plugin is just data — URLs and DOM selectors — and no code is executed. See plugins/README.md for the format and fields and plugins/_template.json for a template; an invalid plugin is skipped and the reason goes to stderr. Only install plugins you trust.
Oh My Pi plugin: plugins/omp/ holds an omp extension that makes WebChatMCP a model provider named webchat. Run /webchat-refresh first; model ids are webchat/<service>/<label>. /webchat-login with no argument discovers all server services, including JSON plugins; failed discovery falls back to ChatGPT, Claude, Grok and Gemini. Explicit service arguments are called directly. Bare service names are not listed. Install and uninstall with the scripts (no root/administrator needed):
# Linux / macOS
plugins/omp/install.sh
plugins/omp/uninstall.sh # uninstall; --purge also deletes the model cache
# Windows (PowerShell)
powershell -ExecutionPolicy Bypass -File plugins\omp\install.ps1
powershell -ExecutionPolicy Bypass -File plugins\omp\uninstall.ps1 # -Purge also deletes the model cache
Every plugin ships install and uninstall scripts. All model plugins (omp, pi, Codex, Claude, Grok, Hermes) support a local tool round trip: the host sends your question and its tool list; the web model only requests a tool with a strict JSON envelope (bound to a per-request nonce, checked against the host's tool names and required arguments — free text is never executed); the plugin turns it into the host's native tool call; the host runs it under its own permissions and confirmations and the result goes back to the web model, until it answers. Every web chat is a fresh private chat, so each turn re-sends complete system instructions, history, earlier tool calls and their results without automatic truncation. File contents and command output you let the host read are sent to the chosen service's platform. No token streaming; install details and limits are in plugins/omp/README.md.
Response extraction keeps every Markdown block of the same message, and code blocks yield just the code body — no language label or copy button. The tool envelope must still cover the whole reply: a preamble, broken JSON or several envelopes is never treated as a tool call.
Codex plugin: plugins/codex/ adds refreshed web models whose names end in (WEB) (e.g. ChatGPT · GPT-5.5 (WEB)) to Codex's model picker. Names with no model label, such as ChatGPT (WEB), are not listed. Picking one sends the chat through WebChatMCP's private chat; requests for official models are forwarded untouched to the official backend. The scripts first close every running Codex and then edit openai_base_url in ~/.codex/config.toml (if Codex cannot be closed they tell you to close it manually and change nothing); uninstalling restores it:
# Linux / macOS
plugins/codex/install.sh
plugins/codex/uninstall.sh # uninstall; --purge also deletes the backup
# Windows (PowerShell)
powershell -ExecutionPolicy Bypass -File plugins\codex\install.ps1
powershell -ExecutionPolicy Bypass -File plugins\codex\uninstall.ps1 # -Purge also deletes the backup
Local tool round trip (Codex runs the tools), no streaming; and while the WebChatMCP server is not running, official models cannot connect either. See plugins/codex/README.md.
Claude plugin: plugins/claude/ adds refreshed web models whose names end in (WEB) (e.g. ChatGPT · GPT-5.5 (WEB)) to Claude Code's /model picker. Names with no model label are not listed. Picking one sends the chat through WebChatMCP's private chat; requests for official models are forwarded untouched to api.anthropic.com. The scripts first close every running Claude (CLI and desktop app) and then set env.ANTHROPIC_BASE_URL and modelPicker in ~/.claude/settings.json (if Claude cannot be closed they tell you to close it manually and change nothing); uninstalling restores it:
# Linux / macOS
plugins/claude/install.sh
plugins/claude/uninstall.sh # uninstall; --purge also deletes the backup
# Windows (PowerShell)
powershell -ExecutionPolicy Bypass -File plugins\claude\install.ps1
powershell -ExecutionPolicy Bypass -File plugins\claude\uninstall.ps1 # -Purge also deletes the backup
Local tool round trip (Claude Code runs the tools), no streaming; and while the WebChatMCP server is not running, official models cannot connect either. See plugins/claude/README.md.
Grok plugin: plugins/grok/ adds refreshed web models whose names end in (WEB) (e.g. ChatGPT · GPT-5.5 (WEB)) to Grok Build's (grok CLI) model picker as custom models. Names with no model label are not listed. Only those models go through WebChatMCP's private chat; official models are untouched. The scripts first close every running grok (including the resident leader process) and then add a marked block to ~/.grok/config.toml (if grok cannot be closed they tell you to close it manually and change nothing); uninstalling removes it:
# Linux / macOS
plugins/grok/install.sh
plugins/grok/uninstall.sh # uninstall; --purge also deletes the backup
# Windows (PowerShell)
powershell -ExecutionPolicy Bypass -File plugins\grok\install.ps1
powershell -ExecutionPolicy Bypass -File plugins\grok\uninstall.ps1 # -Purge also deletes the backup
Local tool round trip (Grok Build runs the tools), no streaming. See plugins/grok/README.md.
Pi plugin: plugins/pi/ holds a pi extension that makes WebChatMCP a model provider named webchat. Run /webchat-refresh first; model ids are webchat/<service>/<label>. /webchat-login with no argument discovers all server services, including JSON plugins; failed discovery falls back to ChatGPT, Claude, Grok and Gemini. Explicit service arguments are called directly. Bare service names are not listed. Install and uninstall with the scripts (no root/administrator needed; restart pi afterwards):
# Linux / macOS
plugins/pi/install.sh
plugins/pi/uninstall.sh # uninstall; --purge also deletes the model cache
# Windows (PowerShell)
powershell -ExecutionPolicy Bypass -File plugins\pi\install.ps1
powershell -ExecutionPolicy Bypass -File plugins\pi\uninstall.ps1 # -Purge also deletes the model cache
Local tool round trip (pi runs the tools), no streaming. See plugins/pi/README.md.
Hermes plugin: plugins/hermes/ installs a keyless named endpoint as providers.webchat in HERMES_HOME/config.yaml, not an API-key profile. Start WebChatMCP first; installation reads the model catalog and refreshes it automatically when empty. IDs are <service>/<label>; bare service names are not listed. The installer removes its old profile and marked dummy-key block, preserves other credentials, and does not change the selected model.provider. Restart Hermes and select WebChat (WebChatMCP) in /model or hermes model — no API_KEY entry is needed:
# Linux / macOS
plugins/hermes/install.sh
plugins/hermes/uninstall.sh # uninstall; --purge also deletes the model cache
# Windows (PowerShell)
powershell -ExecutionPolicy Bypass -File plugins\hermes\install.ps1
powershell -ExecutionPolicy Bypass -File plugins\hermes\uninstall.ps1 # -Purge also deletes the model cache
Requires Hermes with named providers: endpoints and its Python / ruamel.yaml. Options: --url URL / -Url URL sets the bridge address (default http://127.0.0.1:8321/hermes/v1; WEBCHAT_BASE_URL is read at installation); --python PATH / -Python PATH selects Hermes's Python; --refresh-models / -RefreshModels refreshes the catalog; --force / -Force explicitly replaces a foreign same-name configuration. Uninstall only removes this installer's endpoint and preserves the model cache unless purged. Local tool round trip (Hermes runs the tools), no token streaming. See plugins/hermes/README.md.
WebChatMCP.js MCP questions
What tools does WebChatMCP.js MCP provide?
It exposes 8 tools, including webchat_login, webchat_logout, webchat_ask, webchat_models, webchat_status.
Does using this server save my chat history?
No, it uses private or temporary chat modes so that nothing is written to your account's chat history.
Do I need an account to use ChatGPT and Gemini?
No, logging in is optional for ChatGPT and Gemini as they support guest use.
Can I use specific models or thinking depths?
Yes, the server can list available models and thinking depths, and you can specify them per prompt.
How is the browser managed?
The server embeds a persistent Chromium browser using Playwright, which is headless by default unless a manual login is required.