chatgpt-web-agent
chatgpt-web-agent
Eine lokale MCP-Klebeschicht, die es der ChatGPT-Weboberfläche ermöglicht, über den OpenAI Secure MCP Tunnel lokale Werkzeuge zu nutzen.
Dies ist eine ausführbare Referenzimplementierung, kein fertiges Produkt für die Ein-Klick-Installation; sie dient hauptsächlich dazu, einen praktisch validierten Integrationsansatz zu teilen. Benutzer können mit Hilfe des Agenten schnell an ihre lokale Umgebung anpassen.
Die MCP-Schnittstelle des Projekts selbst bleibt stabil, die eigentlichen Werkzeuge werden durch ein austauschbares LocalToolBackend bereitgestellt. Das erste Backend verwendet direkt das OpenClaw Plugin SDK, ohne den OpenClaw-Quellcode zu ändern und ohne Datei-, Shell-, Patch- und Hintergrundprozess-Werkzeuge neu zu implementieren.
Aktueller Status
P0 stellt vier OpenClaw-Werkzeuge bereit:
readexecprocessapply_patch
Optional aktivierbare Google Drive-Dateiaustauschwerkzeuge:
drive_listdrive_searchdrive_statdrive_uploaddrive_downloaddrive_exportdrive_mkdir
Standardmäßig sind zwei schreibgeschützte OpenClaw Skills-Werkzeuge aktiviert:
skills_list(query?, limit?)skill_read(name)
skills_list() gibt ein kompaktes Namensverzeichnis der aktuell berechtigten + modellsichtbaren Skills zurück; mit einer natürlichen Sprachabfrage query kann es über eine separate QMD-Collection eine kleine Anzahl von Kandidaten mit Namen und Beschreibung zurückgeben. skill_read akzeptiert nur den Skill-Namen/-Schlüssel, der kanonische SKILL.md-Pfad wird immer durch das Live-OpenClaw skills.status aufgelöst, der Client liefert keinen Dateipfad. Die MCP-Initialisierungsanweisungen weisen den Client außerdem an: Skills nur dann aktiv zu entdecken, wenn die Aufgabe offensichtlich von lokalen Werkzeugen, Diensten, Workflows oder Betriebsrichtlinien abhängt und der aktuelle Kontext unzureichend ist; normale eigenständige Aufgaben fragen keine Skills ab.
Standardmäßig dürfen Datei- und Patch-Werkzeuge nur auf den konfigurierten Arbeitsbereich zugreifen; exec.workdir muss sich ebenfalls innerhalb des Arbeitsbereichs befinden. Die OpenClaw-internen Parameter host/security/ask/node/elevated werden nicht an den MCP-Client weitergegeben.
Für einen eigenständigen Connector, der nur für vertrauenswürdige ChatGPT-Arbeitsbereiche autorisiert ist, kann CHATGPT_WEB_AGENT_WORKSPACE_ONLY=false gesetzt werden. In diesem Fall ist der Arbeitsbereich nur der Zielort für relative Pfade und das Standard-cwd, read/apply_patch/exec.workdir kann auf externe absolute Pfade zugreifen. Dieser Modus ist keine Sicherheitssandbox.
Die
exec.workdir-Grenze ist keine Befehlssandbox. Ein Client mitexec-Berechtigung kann dennoch über den Befehlstext auf andere Systembereiche zugreifen; der Tunnel sollte nur an vertrauenswürdige ChatGPT-Arbeitsbereiche autorisiert werden und bei Bedarf die OpenClaw-Allowlist/Approval-Richtlinie verwenden.
Related MCP server: agent-mcp-gateway
Entwicklung
Erfordert Node.js 22.22.3 oder eine kompatible OpenClaw-Node-Version sowie pnpm.
pnpm install
pnpm check
pnpm smokeAusführung
export CHATGPT_WEB_AGENT_WORKSPACE=/path/to/workspace
# 可信独立 Connector 如需把 workspace 仅作为默认工作目录:
# export CHATGPT_WEB_AGENT_WORKSPACE_ONLY=false
pnpm build
node dist/cli.jsDer Dienst verwendet MCP stdio, die Standardausgabe trägt nur das MCP-Protokoll.
Konfiguration
Kopieren Sie .env.example, um die verfügbaren Umgebungsvariablen zu sehen. Die Standard-Tool-Whitelist lautet:
read,exec,process,apply_patchexec verwendet standardmäßig allowlist + on-miss. Kann explizit überschrieben werden:
export CHATGPT_WEB_AGENT_EXEC_SECURITY=allowlist
export CHATGPT_WEB_AGENT_EXEC_ASK=on-missFür einen ersten vertrauenswürdigen lokalen Smoke-Test kann vorübergehend verwendet werden:
export CHATGPT_WEB_AGENT_EXEC_SECURITY=full
export CHATGPT_WEB_AGENT_EXEC_ASK=offArchitektur
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(后续按需)Das Skills-Backend dient nur der Capability-Erkennung/-Lektüre; QMD ist lediglich ein Beschleuniger für die Kandidatensuche, das Live-OpenClaw-Inventar ist stets die maßgebliche Quelle für Berechtigung, Modellsichtbarkeit und kanonischen Skill-Pfad.
Semantische Skills-Erkennung
Es wird empfohlen, den semantischen Katalog in einem separaten QMD-named-Index zu platzieren, nicht im gemeinsamen Memory-Index. Der Vektor-ANN von QMD 2.5.3 holt zuerst Kandidaten aus dem gesamten Index und wendet dann den Collection-Filter an; das Mischen von einigen Dutzend Skills mit Zehntausenden von Memory-Dokumenten würde die kleine Collection von Kandidaten aus dem gesamten Index überfluten lassen.
Die aktuelle Bereitstellung verwendet:
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/mcpDie Suche verwendet Qwen3-Embedding-0.6B, nur Vektoren, rerank=false, keine Query-Expansion / HyDE. QMD-Treffer sind nur Kandidaten; vor der Rückgabe wird die Schnittmenge mit dem Live-skills.status gebildet. Das Katalogschema/-inventar wird über catalogHash auf Generationsungültigkeit geprüft; bei Nichtverfügbarkeit von QMD oder veraltetem Katalog wird automatisch auf das Live-Names-only-Katalog zurückgegriffen.
Google Drive
Drive ist ein optionaler Datenkanal, keine Hintergrundsynchronisation, Festplatteneinbindung oder vollständige Datenträgerspiegelung. Die Implementierung verwendet direkt die Google Drive API v3, MCP stellt nur kleine, stabile Dateioperationsprimitive bereit.
Standardmäßig können lokale Upload-/Download-/Exportpfade von Drive nur in:
<CHATGPT_WEB_AGENT_WORKSPACE>/exchangeDiese Einschränkung ist unabhängig von CHATGPT_WEB_AGENT_WORKSPACE_ONLY und dient dazu, das Risiko zu verringern, dass Drive-Werkzeuge als Kanal für den Export beliebiger lokaler Daten missbraucht werden. Bei Bedarf kann der Bereitsteller dies über CHATGPT_WEB_AGENT_DRIVE_LOCAL_ROOT und CHATGPT_WEB_AGENT_DRIVE_LOCAL_ROOT_ONLY anpassen.
Einmalige OAuth-Konfiguration
Aktivieren Sie die Drive-API in Google Cloud und erstellen Sie einen Desktop-OAuth-Client.
Speichern Sie das heruntergeladene OAuth-JSON als:
<workspace>/.credentials/google-drive/credentials.jsonOder setzen Sie
CHATGPT_WEB_AGENT_DRIVE_CREDENTIALSauf einen anderen lokalen privaten Pfad.Führen Sie aus:
CHATGPT_WEB_AGENT_WORKSPACE=/path/to/workspace pnpm drive:authNach Abschluss der Browser-Autorisierung wird ein Authorized-User-Token mit Berechtigung
0600erstellt. Das OAuth-Client-Secret und das Refresh-Token sollten nicht in Git committet und nicht über MCP zurückgegeben werden.Setzen Sie beim Start des Dienstes:
export CHATGPT_WEB_AGENT_DRIVE_ENABLED=true
In den Drive-Werkzeugen verwenden folderId / fileId direkt die Drive-API-ID. Normale Binärdateien verwenden drive_download; Google Docs/Sheets/Slides verwenden drive_export zum Export in den angegebenen MIME-Typ.
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.
Remote MCP access to user-authorized Linux, Windows and Intel Mac devices for AI assistants.
Search your AI chat history (ChatGPT, Claude, Codex) from any MCP client. Remote, private, read-only
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