OpenAI Secure MCP Tunnel

OpenAI Secure MCP Tunnel

Enables file operations and bash command execution on the local workspace, securely exposed to ChatGPT via OpenAI Tunnel.

Category
Visit Server

README

OpenAI Secure MCP Tunnel

一个基于 TypeScript 的 MCP 文件工具服务,通过 OpenAI Tunnel Client 将本地 stdio MCP 服务安全暴露给工作区。

功能

  • read:读取工作区内的文本文件
  • write:创建或覆盖工作区内的文本文件
  • edit:精确替换文件内容
  • bash:在工作区内执行 PowerShell 命令

文件工具会限制路径必须位于工作区目录内。

技术栈

  • Node.js 24+
  • pnpm 11
  • TypeScript
  • pnpm workspace + Turborepo
  • Vite Plus(Oxfmt、Oxlint、类型检查)

目录结构

apps/mcp-server          MCP 服务入口
packages/pi-adapter      文件和命令工具适配层
packages/types           共享类型
scripts/tunnel-client       Tunnel Client 启动脚本和配置

快速开始

安装依赖:

vp install

首次配置

  1. 打开 Tunnels 管理页面,创建 Tunnel,将生成的 Tunnel ID 填入 CONTROL_PLANE_TUNNEL_ID
  2. 打开 API Keys 页面,创建 API Key,将生成的 Key 填入 CONTROL_PLANE_API_KEY
  3. 在项目根目录创建 .env.local
CONTROL_PLANE_TUNNEL_ID=tunnel_...
CONTROL_PLANE_API_KEY=sk-...
TUNNEL_CLIENT_PATH=./tunnel-client.exe
MCP_WORKSPACE_ROOT=.

TUNNEL_CLIENT_PATHMCP_WORKSPACE_ROOT 均可选;未配置时分别默认使用当前工作目录下的 tunnel-client.exe 和当前工作目录。相对路径以当前工作目录为基准解析。

下载 Tunnel Client

请从 OpenAI 控制台的 Tunnels 管理页面 下载与你的系统匹配的 tunnel-client,并将 Windows 可执行文件放到:

./tunnel-client.exe

也可以查看 OpenAI tunnel-client 仓库 获取文档和源码。下载后可先检查配置:

.\tunnel-client.exe doctor `
  --config .\scripts\tunnel-client\tunnel-client.yaml `
  --explain

启用 Vite Plus 提交前检查:

pnpm setup:hooks

启动 Tunnel:

pnpm start-tunnel

构建独立 Tunnel Client 启动目录:

pnpm build-tunnel

该命令生成 dist-tunnel-client,不复制 tunnel-client.exe,也不会自动复制 .env.local。首次使用时请自行将 .env.local 复制到该目录,并将 exe 放入该目录,或在其中配置 TUNNEL_CLIENT_PATH。重复构建时会保留已有的 dist-tunnel-client/.env.local

从项目根目录快速启动打包版本。请先将 .env.localtunnel-client.exe 放入 dist-tunnel-client,并在其中的 .env.local 配置:

MCP_WORKSPACE_ROOT=..

然后在终端中执行:

cd dist-tunnel-client
node start-cli.js

上述命令适用于 Windows、macOS 和 Linux;退出 Tunnel Client 后可执行 cd .. 返回项目根目录。

Tunnel Client 的本地运维地址:

本地 Tunnel 启动后,打开 ChatGPT Plugins,在其中添加对应的 Plugin。

开发命令

pnpm format        # 格式化代码
pnpm lint          # 静态检查
pnpm quality       # 格式化、lint 和类型检查
pnpm check         # workspace 类型检查
pnpm build         # 构建全部 workspace
pnpm ci            # CI 全量检查

也可以单独启动 MCP 服务:

pnpm start-mcp-server

请勿将 .env.local、API Key 或 Tunnel 凭据提交到 Git。

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured