OpenAI Secure MCP Tunnel
OpenAI Secure MCP Tunnel
Turborepo モノレポです:mcp-tunnel は、ローカルの stdio MCP サービスを OpenAI Tunnel Client 経由でワークスペースに公開します。コアツールとオプション拡張はすべてワークスペースパッケージとして提供され、将来は独立した apps/mcp-* コンポジションアプリを追加できます。
アーキテクチャ
apps/mcp-tunnel 当前 Tunnel 专用 MCP 应用和运行脚本
packages/mcp-tool-runtime 通用 tool 注册、配置与结果协议
packages/mcp-tools-core read / write / edit / bash
packages/mcp-tools-extra read_image / read_many / edit_many / notify
packages/mcp-image-adapter 图片读取和 sharp 转码(按需加载)
packages/pi-adapter 工作区文件、编辑、命令和路径安全适配開発環境では pnpm stub(postinstall でも実行)を使用して unbuild --stub を実行するため、パッケージを変更するたびに手動で build する必要はありません。
Related MCP server: localmcpcoder
現在の Tunnel アプリ設定
すべてのランタイムファイルは apps/mcp-tunnel/ にあります:.env.local、Tunnel Client バイナリ、ログ、dist-tunnel-client/。このアプリの .env.local を作成します:
CONTROL_PLANE_TUNNEL_ID=tunnel_...
CONTROL_PLANE_API_KEY=sk-...
# 可选;相对路径以 apps/mcp-tunnel 为基准
TUNNEL_CLIENT_PATH=./tunnel-client.exe
MCP_WORKSPACE_ROOT=.
# 未配置时只启用 core;配置时仅启用列出的工具
TOOLS_ENABLED=read,write,edit,bash,read_image,read_many,edit_many,notifyhttps://platform.openai.com/settings/organization/tunnels ここで tunnel を作成 -> CONTROL_PLANE_TUNNEL_ID
https://platform.openai.com/settings/organization/api-keys ここで api-key を作成 -> CONTROL_PLANE_API_KEY
https://chatgpt.com/plugins ローカル起動後、ここで plugins を追加します
TOOLS_ENABLED が未設定の場合、read、write、edit、bash のみが有効になります。設定が空の場合は tool を公開しません。設定が空でない場合は、リストされた tool のみを公開します。拡張コードは動的 import で読み込まれ、read_image とその sharp 依存関係は明示的に有効にした場合のみ読み込まれます。
MCP_WORKSPACE_ROOT はカンマ区切りのディレクトリと glob パターンをサポートします。例:D:/Workspace/ai-projects/*,C:/Users/Maple/.codex-cc。相対パスは最初に一致したディレクトリを基準とし、絶対パスは一致した任意のディレクトリ内のファイルにアクセスできます。
read_image は PNG、JPEG、GIF、WebP をサポートします。相対パスはワークスペース境界の制約を受け、絶対パスはローカル画像を読み取る互換動作を維持します。大きな画像は自動的にリサイズ/WebP 変換されます。edit_many は順番に実行され、アトミック操作ではありません。
起動とデプロイ
pnpm start:mcp-tunnel
pnpm start:mcp-tunnel:pm2
pnpm stop:mcp-tunnel:pm2
pnpm build:mcp-tunnel最初のコマンドは Tunnel をフォアグラウンドで起動します。2 番目のコマンドはグローバルインストールされた PM2 を使用してこのアプリを管理します。3 番目のコマンドは PM2 レコードを停止して削除します。先に npm install --global pm2 を実行してください。PM2 はプロジェクトの依存関係には含まれず、スタンドアロンパッケージにも含まれません。Windows では、PM2 が管理する Tunnel Client は常駐コンソールウィンドウを非表示にします。フォアグラウンド起動では引き続き出力が表示されます。
スタンドアロンパッケージは apps/mcp-tunnel/dist-tunnel-client/ に生成され、.env.local、Tunnel Client バイナリ、node_modules は含まれません。認証情報とバイナリをこのディレクトリに配置した後、node start-cli.js を実行します。node start-pm2.js を実行する場合、ホストマシンにもグローバル PM2 が必要です。
macOS launchd はオプションの互換レイヤーです:
pnpm --filter @workspace/mcp-tunnel install:macos-launchdこれはログイン時に PM2 ドライバスクリプトを呼び出すだけで、実際の常駐と再起動は PM2 が管理します。
開発と検証
pnpm stub
pnpm check
pnpm build
pnpm testアプリ内の .env.local、Tunnel 認証情報、バイナリファイルをコミットしないでください。
This server cannot be deployed
Maintenance
Related MCP Connectors
Securely search and manage workspace context files for AI agents and teams.
Develop, manage, and debug Railway projects, services, and deployments from within agents.
Manage files and folders directly from your workspace. Read and write files, list directories, cre…
Operate Linux, macOS and Windows from your LLM. Every action runs through an auditable allowlist.
Related MCP Servers
- AlicenseNot gradedqualityAmaintenanceEnables ChatGPT to inspect and edit local projects through a secure MCP interface, offering workspace management, file operations, git integration, and safe command execution.4MIT
- AlicenseNot gradedqualityCmaintenanceEnables remote MCP clients like ChatGPT to run shell commands and manage files on your local machine via a Cloudflare tunnel, exposing tools for file operations, search, and task management.1MIT
- AlicenseNot gradedqualityDmaintenanceEnables ChatGPT to securely control a local workstation via an MCP tunnel, exposing 44 tools for file/project editing, git, process supervision, browser automation, and Office document handling across macOS, Linux, and Windows.5MIT
- FlicenseNot gradedqualityBmaintenanceEnables external AI (ChatGPT, Claude) to securely access a local workspace via Cloudflare Tunnel, providing file operations, shell commands, Git operations, and more with bearer token authentication and sandbox isolation.1-