ChatGPT2LocalBridge

ChatGPT2LocalBridge

Self-hosted MCP server that enables ChatGPT to access and operate on local project files after OAuth authorization, without uploading the workspace elsewhere.

Category
访问服务器

README

<div align="center"> <img src="./docs/assets/logo.png" alt="ChatGPT2LocalBridge logo" width="180" /> <h1>ChatGPT2LocalBridge</h1> <p><strong>OAuth MCP Connector for approved local files.</strong></p> <p> <img alt="License" src="https://img.shields.io/badge/license-MIT-blue.svg" /> <img alt="Node" src="https://img.shields.io/badge/node-%3E%3D20-339933.svg" /> <img alt="MCP" src="https://img.shields.io/badge/MCP-Streamable%20HTTP-1769e0.svg" /> <img alt="Status" src="https://img.shields.io/badge/status-alpha-f59e0b.svg" /> </p> <p> <a href="./docs/index.html">Pages source</a> · <a href="./docs/showcase.html">Showcase</a> · <a href="./docs/human-tutorial.html">Human tutorial</a> · <a href="./docs/agent-computer-use.html">Agent tutorial</a> · <a href="./docs/alternatives.md">Alternatives</a> · <a href="./docs/sync-flows.md">Sync flows</a> </p> </div>

ChatGPT2LocalBridge cover

<!-- showcase:start --> <p align="center"> <img src="./docs/assets/thumbnail-responsive.png" alt="ChatGPT2LocalBridge responsive preview" width="900" /> </p> <!-- showcase:end -->

ChatGPT2LocalBridge is a self-hosted MCP server that lets ChatGPT access approved local workspaces after OAuth authorization. It is designed for people who want ChatGPT to inspect or operate on local project files without uploading the whole workspace elsewhere.

It is not a legacy ChatGPT plugin. It is best described as:

  • MCP Server
  • ChatGPT Custom Connector
  • OAuth Local Workspace Bridge

Unofficial project. Not affiliated with OpenAI.

Route

ChatGPT
  -> OAuth MCP Connector
  -> HTTPS tunnel
  -> http://127.0.0.1:3838/mcp
  -> ChatGPT2LocalBridge
  -> approved local workspace roots

ChatGPT does not directly mount your disk. It calls MCP tools, and every file operation is checked against bridge.policy.json.

30-Second Install

npx github:harzva/chatgpt2localbridge init --root ~/Projects
set -a; source .env.local; set +a
npx github:harzva/chatgpt2localbridge --http 3838

Local clone flow:

git clone https://github.com/harzva/chatgpt2localbridge.git
cd chatgpt2localbridge
npm install
npm run build
node dist/index.js init --root ~/Projects
set -a; source .env.local; set +a
node dist/index.js --http 3838

Health check:

curl -sS http://127.0.0.1:3838/health

Local operator console:

http://127.0.0.1:3838/app

ChatGPT Connector Setup

Expose the local server through HTTPS:

ngrok http 3838 --url=your-fixed-domain.ngrok-free.dev

Then create a ChatGPT Custom Connector:

Field Value
Name ChatGPT2LocalBridge
URL https://your-fixed-domain.ngrok-free.dev/mcp
Auth OAuth

When the authorization page opens, enter the unlock code from .env.local. Do not paste unlock codes or tokens into public chats, issues, screenshots, or commits.

Screenshot Walkthrough

Step Preview
Initialize local policy Initialize
Run local MCP server Run
Check /health Health
Create connector Connector
Authorize Authorize
Test file listing Success

Full guides:

Main MCP Tools

Area Examples
Project project.snapshot, project.index, project.scripts
Code code.read, code.read_range, code.search
Files file.list, file.stat, file.write, file.patch, file.delete
Shell/tests shell.exec, test.detect, test.run
Git git.status, git.diff, git.checkpoint, git.revert
Runtime workspace.*, task.*, process.*, port.check
Cloud sync cloud.download
Bridge bridge.status, bridge.health, bridge.logs, bridge.activity, service.restart

File Sync And Activity

  • Local files can be read by ChatGPT through approved MCP tools.
  • ChatGPT/App-provided cloud file download URLs can be written back to local disk with cloud.download.
  • Tool calls are persisted to tool-calls.jsonl.
  • File writes, downloads, tasks, processes, and service restarts are persisted to audit.jsonl.
  • The local console at /app shows status, tool calls, and audit events.

See file sync flows.

Security Defaults

  • Do not run unauthenticated on a public URL.
  • Keep allowedProjectRoots narrow.
  • Never commit .env.local, bridge.policy.json, OAuth stores, tokens, cookies, or unlock codes.
  • Prefer OAuth over URL tokens.
  • Set LOCALBRIDGE_DASHBOARD_TOKEN before using /app.
  • Review shell deny rules before enabling shell access for broad workspaces.

See security model.

Alternatives

OAuth + fixed HTTPS tunnel is the default because it fits ChatGPT Custom Connectors well. Other options exist:

  • OpenAI Secure MCP Tunnel, when available to your workspace
  • Cloudflare Tunnel
  • VPS reverse proxy
  • Static bearer token for private clients
  • Loopback-only no-auth testing

See alternatives.

GitHub Pages

The static product site lives in docs/. The repository includes a GitHub Actions workflow that deploys it to GitHub Pages after pushing to main.

Development

npm install
npm run typecheck
npm test
npm pack --dry-run

Render README and docs assets:

npm run docs:assets
npm run docs:preview

Public Release Checklist

  • [ ] Enable GitHub Pages with the included workflow.
  • [ ] Confirm npm test passes in GitHub Actions.
  • [ ] Keep .env.local and bridge.policy.json untracked.
  • [ ] Verify the ChatGPT connector uses OAuth and the correct /mcp URL.

License

MIT

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选