chatgpt-web-agent
This server is a local MCP glue layer that lets ChatGPT Web use local tools through OpenAI Secure MCP Tunnel.
Read text or image files with offset/limit support
Apply patches to files
Execute shell commands with env, workdir, timeout, PTY, background/yieldMs support
Manage long-running shell sessions via process actions: list, poll, log, write, send-keys, submit, paste, kill
Run a direct rescue_exec bash command for diagnostics/fixes when exec is unavailable or stuck
Discover and read eligible/visible OpenClaw Skills
Optional Google Drive file operations: list, search, stat, upload, download, export, mkdir
Optional Feishu messaging and directory discovery for groups, users, members, and bots
Request-ledger and full-trace diagnostic logging for troubleshooting
Provides tools for interacting with Google Drive, including listing, searching, uploading, downloading, exporting, and managing files and folders, with file exchange restricted to a designated workspace directory.
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., "@chatgpt-web-agent read the src directory and list all TypeScript files"
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.
chatgpt-web-agent
A local MCP glue layer that lets the ChatGPT web client use local tools via the OpenAI Secure MCP Tunnel.
This is a runnable reference implementation, not a polished one-click install product; its main purpose is to share a proven integration approach. Users can quickly adapt it to their local environment with the help of an Agent.
The project's own MCP interface remains stable; real tools are provided by a replaceable LocalToolBackend. The first backend directly reuses the OpenClaw Plugin SDK, without modifying OpenClaw source code or reimplementing file, shell, patch, and background process tools.
Current Status
P0 provides four OpenClaw tools:
readexecprocessapply_patch
Optional Google Drive file exchange tools:
drive_listdrive_searchdrive_statdrive_uploaddrive_downloaddrive_exportdrive_mkdir
Two read-only OpenClaw Skills tools are enabled by default:
skills_list(query?, limit?)skill_read(name)
skills_list() returns a compact name directory of currently eligible + model-visible Skills; when a natural language query is provided, it returns a small set of candidate names and descriptions via a separate QMD collection. skill_read only accepts a Skill name/key; the canonical SKILL.md path is always resolved from the live OpenClaw skills.status and does not accept a file path from the client. The MCP initialize instructions also hint to the client: only proactively discover Skills when the task clearly might depend on local tools, services, workflows, or operational norms and the current context is insufficient; do not query Skills for ordinary self-contained tasks.
By default, file and patch tools are only allowed to access the configured workspace; exec.workdir must also be within the workspace. OpenClaw's internal host/security/ask/node/elevated parameters are not exposed to the MCP client.
For a standalone Connector only authorized for a trusted ChatGPT workspace, you can set
CHATGPT_WEB_AGENT_WORKSPACE_ONLY=false. In this case, the workspace is only the fallback for relative paths and the default cwd; read/apply_patch/exec.workdir can access external absolute paths. This mode is not a security sandbox.
The
exec.workdirboundary is not a command sandbox. A client withexecpermission may still access other parts of the system in the command text; only authorize the Tunnel for a trusted ChatGPT workspace, and use OpenClaw's allowlist/approval policies as needed.
Related MCP server: agent-mcp-gateway
Development
Requires Node.js 22.22.3 or a compatible OpenClaw Node version, and pnpm.
pnpm install
pnpm check
pnpm smokeRunning
export CHATGPT_WEB_AGENT_WORKSPACE=/path/to/workspace
# 可信独立 Connector 如需把 workspace 仅作为默认工作目录:
# export CHATGPT_WEB_AGENT_WORKSPACE_ONLY=false
pnpm build
node dist/cli.jsThe service uses MCP stdio; standard output only carries the MCP protocol.
Configuration
Copy .env.example to see available environment variables. The default tool allowlist is:
read,exec,process,apply_patchexec uses allowlist + on-miss by default. You can explicitly override:
export CHATGPT_WEB_AGENT_EXEC_SECURITY=allowlist
export CHATGPT_WEB_AGENT_EXEC_ASK=on-missFor an initial trusted local smoke test, you can temporarily use:
export CHATGPT_WEB_AGENT_EXEC_SECURITY=full
export CHATGPT_WEB_AGENT_EXEC_ASK=offArchitecture
ChatGPT Web
→ OpenAI Secure MCP Tunnel
→ chatgpt-web-agent MCP Server
→ LocalToolBackend
→ OpenClawBackend
→ SkillsBackend → OpenClaw Gateway (live status)
→ QMD MCP (optional semantic discovery)
→ NativeBackend / other backend(后续按需)The Skills backend only does capability discovery/read; QMD is only a candidate retrieval accelerator; the live OpenClaw inventory is always the source of truth for eligibility, model visibility, and canonical Skill paths.
Skills semantic discovery
It is recommended to place the semantic catalog in a separate QMD named index, rather than sharing the memory index. QMD 2.5.3's vector ANN first retrieves candidates from the entire index and then applies the collection filter; mixing a few dozen Skills with tens of thousands of memory documents would cause the small collection to be overwhelmed by candidates from the full index.
The current deployment uses:
local catalog: <workspace>/skills-catalog/
M4 mirror: ~/qmd-data/skills-chatgpt-web-agent/
QMD index: skills-chatgpt-web-agent
collection: skills-chatgpt-web-agent
MCP endpoint: http://192.168.0.96:8182/mcpRetrieval uses Qwen3-Embedding-0.6B, vector-only, rerank=false, without query expansion / HyDE. QMD hits are only candidates; they are still intersected with the live skills.status before returning. The catalog schema/inventory uses catalogHash for generation invalidation; when QMD is unavailable or the catalog is stale, it falls back to a live names-only catalog.
Google Drive
Drive is an optional data channel; it does not do background sync, disk mounting, or full disk mirroring. The implementation directly uses the Google Drive API v3; MCP only exposes small, stable file operation primitives.
By default, Drive's local upload/download/export paths can only be located in:
<CHATGPT_WEB_AGENT_WORKSPACE>/exchangeThis restriction is independent of CHATGPT_WEB_AGENT_WORKSPACE_ONLY and is intended to reduce the risk of Drive tools being misused as an arbitrary local data exfiltration channel. If necessary, deployers can adjust it via CHATGPT_WEB_AGENT_DRIVE_LOCAL_ROOT and CHATGPT_WEB_AGENT_DRIVE_LOCAL_ROOT_ONLY.
One-time OAuth configuration
Enable the Drive API in Google Cloud and create a Desktop OAuth client.
Save the downloaded OAuth JSON as:
<workspace>/.credentials/google-drive/credentials.jsonOr set
CHATGPT_WEB_AGENT_DRIVE_CREDENTIALSto point to another local private path.Run:
CHATGPT_WEB_AGENT_WORKSPACE=/path/to/workspace pnpm drive:authAfter browser authorization completes, an authorized-user token with permissions
0600will be generated. The OAuth client secret and refresh token should not be committed to Git, nor returned via MCP.When starting the service, set:
export CHATGPT_WEB_AGENT_DRIVE_ENABLED=true
The folderId / fileId in Drive tools directly use Drive API IDs. Use drive_download for ordinary binary files; use drive_export for Google Docs/Sheets/Slides to export to the specified MIME type.
Available Tools
6 toolsapply_patchapply_patchC
Apply a patch to one or more files using the apply_patch format. The input should include *** Begin Patch and *** End Patch markers.
Inputs: input (required).
execexecA
Execute shell commands with background continuation for work that starts now. Use yieldMs/background to continue later via process tool. For long-running work started now, rely on automatic completion wake when it is enabled and the command emits output or fails; otherwise use process to confirm completion. Use process whenever you need logs, status, input, or intervention. Use pty=true for TTY-required commands (terminal UIs, coding agents).
Inputs: command (required), env, pty, timeout, +3 more.
processprocessA
Manage running exec sessions for commands already started: list, poll, log, write, send-keys, submit, paste, kill. Use poll/log when you need status, logs, quiet-success confirmation, or completion confirmation when automatic completion wake is unavailable. Use poll/log also for input-wait hints. Use write/send-keys/submit/paste/kill for input or intervention.
Inputs: action (required), eof, hex, data, +8 more.
readreadA
Read the contents of a file. Supports text files and images (jpg, png, gif, webp, bmp). Images are sent as attachments. For text files, output is truncated to 2000 lines or 50KB (whichever is hit first). Use offset/limit for large files. When you need the full file, continue with offset until complete.
Inputs: path (required), limit, offset.
skill_readA
Read one currently eligible/model-visible OpenClaw Skill by its name or skillKey. Use after skills_list identifies a likely match. This tool does not accept filesystem paths.
Inputs: name (required).
skills_listA
Discover local OpenClaw Skills available to ChatGPT Web. Pass a natural-language task description in query to get a small semantic top-k with descriptions. Without query, returns the compact names-only live catalog. Only currently eligible and model-visible Skills are surfaced.
Inputs: limit, query.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 6 tools
Each tool has a distinct purpose: file reading, patch application, command execution, process management, and skills listing/reading. Descriptions clearly differentiate them.
Most tools use verb-like names with a mix of underscore and no-underscore styles (e.g., 'read' vs 'skills_list'). The convention is not fully uniform but remains understandable.
Six tools is appropriate for a coding-agent server, covering core operations without being excessive or sparse.
The suite covers file access, modifications, command execution, background process management, and skill discovery, leaving no obvious gaps for common agent workflows.
Maintenance
Related MCP Connectors
Connect ChatGPT and Claude to your Mac, Windows or Linux with secure MCP remote access.
Use your Mac, Windows or Linux computer from ChatGPT, Claude or Codex: files, commands, documents.
Search your AI chat history (ChatGPT, Claude, Codex) from any MCP client. Remote, private, read-only
MCP connector that lets ChatGPT list, search, and run your Apple Shortcuts via a local Mac agent
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables ChatGPT web to interact with local Windows/WSL shell and code workspaces via an MCP server, providing file access, shell execution, and snapshot-based workspace management with per-command authorization.18MIT
- FlicenseNot gradedqualityDmaintenanceEnables ChatGPT Web to securely access local files and run commands via MCP, with optional OpenCode agent mode for autonomous tasks.-
- FlicenseBqualityAmaintenanceEnables ChatGPT Web to securely control a trusted local computer through an OpenAI Secure MCP Tunnel, letting it perform file, process, Git, and other system operations on Windows, macOS, and Linux.62-
- AlicenseNot gradedqualityCmaintenanceTurns ChatGPT web into a local coding agent, enabling file edits, shell commands, Git operations, patches, and process management through 40+ MCP tools.MIT