Skip to main content
Glama
chatgpt-web-agent
by AxelHu

chatgpt-web-agent

ChatGPT Web版がOpenAI Secure MCP Tunnelを通じてローカルツールを使用するためのローカルMCPグルー層。

これは実行可能なリファレンス実装であり、ワンクリックでインストールできる完成品を目指すものではありません。主に実際に検証済みの接続アプローチを共有するためのもので、利用者はエージェントを利用して自身のローカル環境に素早く適応できます。

プロジェクト自身のMCPインターフェースは安定しており、実際のツールは交換可能なLocalToolBackendによって提供されます。最初のバックエンドはOpenClaw Plugin SDKを直接再利用し、OpenClawのソースコードを変更せず、ファイル、シェル、パッチ、バックグラウンドプロセスツールを再実装しません。

現在のステータス

P0は4つのOpenClawツールを提供します:

  • read

  • exec

  • process

  • apply_patch

オプションでGoogle Driveファイル交換ツールを有効化:

  • drive_list

  • drive_search

  • drive_stat

  • drive_upload

  • drive_download

  • drive_export

  • drive_mkdir

デフォルトで2つの読み取り専用OpenClaw Skillsツールを有効化:

  • skills_list(query?, limit?)

  • skill_read(name)

skills_list()は現在のeligible + model-visible Skillのコンパクトな名前ディレクトリを返します。自然言語のqueryがある場合は、独立したQMDコレクションを介して少数の候補名と説明を返します。skill_readはSkill名/キーのみを受け付け、正規のSKILL.mdパスは常にリアルタイムのOpenClaw skills.statusによって解決され、クライアント提供のファイルパスは受け付けません。MCP initialize instructionsでは、クライアントに対して、タスクが明らかにローカルツール、サービス、ワークフロー、または操作規範に依存する可能性が高く、現在のコンテキストが不足している場合にのみ能動的にSkillを発見するよう促します。通常の自己完結型タスクではSkillを照会しません。

デフォルトでは、ファイルツールとパッチツールは設定されたworkspaceにのみアクセスを許可します。exec.workdirもworkspace内に存在する必要があります。OpenClaw内部のhost/security/ask/node/elevatedパラメータはMCPクライアントに公開されません。

信頼できるChatGPT workspaceにのみ認可された独立したConnectorの場合、CHATGPT_WEB_AGENT_WORKSPACE_ONLY=falseを設定できます。この場合、workspaceは相対パスとデフォルトcwdの基点となり、read/apply_patch/exec.workdirは外部の絶対パスにアクセスできます。このモードはセキュリティサンドボックスではありません。

exec.workdirの境界はコマンドサンドボックスではありません。exec権限を得たクライアントは、コマンドテキスト内でシステムの他の場所にアクセスする可能性があります。Tunnelは信頼できるChatGPT workspaceにのみ認可し、必要に応じてOpenClawのallowlist/approvalポリシーを使用してください。

Related MCP server: agent-mcp-gateway

開発

Node.js 22.22.3または互換性のあるOpenClaw Nodeバージョン、およびpnpmが必要です。

pnpm install
pnpm check
pnpm smoke

実行

export CHATGPT_WEB_AGENT_WORKSPACE=/path/to/workspace
# 可信独立 Connector 如需把 workspace 仅作为默认工作目录:
# export CHATGPT_WEB_AGENT_WORKSPACE_ONLY=false
pnpm build
node dist/cli.js

サービスはMCP stdioを使用し、標準出力はMCPプロトコルのみを伝送します。

設定

.env.exampleをコピーして利用可能な環境変数を確認してください。デフォルトのツールホワイトリストは以下の通りです:

read,exec,process,apply_patch

execはデフォルトでallowlist + on-missを使用します。明示的に上書きできます:

export CHATGPT_WEB_AGENT_EXEC_SECURITY=allowlist
export CHATGPT_WEB_AGENT_EXEC_ASK=on-miss

ローカルで信頼された初回smokeテストを行う場合、一時的に次のように使用できます:

export CHATGPT_WEB_AGENT_EXEC_SECURITY=full
export CHATGPT_WEB_AGENT_EXEC_ASK=off

アーキテクチャ

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(后续按需)

Skills backendはcapability discovery/readのみを行います。QMDは候補検索のアクセラレーターに過ぎず、リアルタイムのOpenClaw inventoryが常にeligibility、model visibility、正規のSkillパスの事実上の情報源です。

Skills semantic discovery

semantic catalogは共有memory indexではなく、独立したQMD named indexに配置することを推奨します。QMD 2.5.3のvector ANNはまずインデックス全体から候補を取得し、その後コレクションフィルターを適用します。数十件のSkillを数万件のmemoryドキュメントに混ぜると、小さなコレクションが全ライブラリの候補に埋もれてしまいます。

現在のデプロイメントでは以下を使用しています:

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/mcp

検索にはQwen3-Embedding-0.6B、vector-only、rerank=falseを使用し、query expansion / HyDEは行いません。QMDのヒットは単なる候補です。返却前にライブのskills.statusと共通部分を取ります。catalog schema/inventoryはcatalogHashで世代の無効化を行い、QMDが利用不可またはcatalogが古い場合は自動的にライブのnames-only catalogにフォールバックします。

Google Drive

Driveはオプションのデータチャネルであり、バックグラウンド同期、ディスクマウント、ディスク全体のミラーリングは行いません。実装はGoogle Drive API v3を直接使用し、MCPは小さく安定したファイル操作プリミティブのみを公開します。

デフォルトでは、Driveのローカルアップロード/ダウンロード/エクスポートパスは次の場所のみに制限されます:

<CHATGPT_WEB_AGENT_WORKSPACE>/exchange

この制限はCHATGPT_WEB_AGENT_WORKSPACE_ONLYとは独立しており、Driveツールが任意のローカルデータの外部転送チャネルとして誤用されるリスクを低減します。必要に応じて、デプロイ担当者がCHATGPT_WEB_AGENT_DRIVE_LOCAL_ROOTとCHATGPT_WEB_AGENT_DRIVE_LOCAL_ROOT_ONLYで調整できます。

ワンタイムOAuth設定

  1. Google CloudでDrive APIを有効にし、Desktop OAuthクライアントを作成します。

  2. ダウンロードしたOAuth JSONを次の場所に保存します:

    <workspace>/.credentials/google-drive/credentials.json

    または、CHATGPT_WEB_AGENT_DRIVE_CREDENTIALSを設定して他のローカルのプライベートパスを指定します。

  3. 次のコマンドを実行します:

    CHATGPT_WEB_AGENT_WORKSPACE=/path/to/workspace pnpm drive:auth

    ブラウザでの認可が完了すると、権限が0600のauthorized-user tokenが生成されます。OAuth client secretとrefresh tokenはGitにコミットせず、MCP経由で返されることもありません。

  4. サービス起動時に次のように設定します:

    export CHATGPT_WEB_AGENT_DRIVE_ENABLED=true

DriveツールのfolderId / fileIdはDrive API IDを直接使用します。通常のバイナリファイルはdrive_downloadを使用します。Google Docs/Sheets/Slidesはdrive_exportを使用して指定されたMIMEタイプにエクスポートします。

Available Tools

6 tools
apply_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

    A4/5.0

    Scored across 6 tools

    Disambiguation5/5

    Each tool has a distinct purpose: file reading, patch application, command execution, process management, and skills listing/reading. Descriptions clearly differentiate them.

    Naming Consistency4/5

    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.

    Tool Count5/5

    Six tools is appropriate for a coding-agent server, covering core operations without being excessive or sparse.

    Completeness5/5

    The suite covers file access, modifications, command execution, background process management, and skill discovery, leaving no obvious gaps for common agent workflows.

    Maintenance

    ActivityActive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      D
      maintenance
      Enables ChatGPT Web to securely access local files and run commands via MCP, with optional OpenCode agent mode for autonomous tasks.
      -
    • A
      license
      Not graded
      quality
      C
      maintenance
      Turns ChatGPT web into a local coding agent, enabling file edits, shell commands, Git operations, patches, and process management through 40+ MCP tools.
      MIT