LLMBridge
Turn your VS Code workspace into a remote MCP (Model Context Protocol) server so browser-based AI tools — Claude, ChatGPT, Gemini — can safely read and edit your local code.
Local-first. The MCP server runs inside VS Code on your machine (127.0.0.1). Your code never leaves disk. An optional ngrok/Cloudflare tunnel exposes it to the internet so remote AI clients can connect.
Branch layout
| Branch |
What it is |
main |
Current. VS Code extension + MCP server approach (this document). |
master |
Prior art: the original Chrome browser extension using Native Messaging to let local scripts talk to ChatGPT/Gemini, preserved unchanged for history. |
Everything below describes the main branch.
Features
- MCP server running inside VS Code on
http://127.0.0.1:<port>/mcp (streamable HTTP; POST only).
- 29 MCP tools across 8 domains:
- Files (7):
read_file, search_file, write_file, create_file, delete_file, create_directory, delete_directory
- Git (6, read-only):
git_status, git_branch, git_diff, git_log, git_show, git_staged_diff
- Terminal (1):
run_command
- Processes (6):
start_process, read_process_output, read_terminal, list_processes, send_process_input, stop_process
- Diagnostics & tests (2):
get_diagnostics, run_tests
- HTTP (1):
http_request
- Context (2):
get_project_context, update_project_context
- Workspace (4):
get_workspace_info, get_active_editor, get_environment, list_local_servers
- Authentication: MCP token generated locally, stored in VS Code SecretStorage, and accepted as an
access_token query param, Authorization: Bearer header, or X-LLMBridge-Token header. Constant-time comparison; regenerate any time.
- Security: workspace-root confinement (no traversal, no symlink escape), sensitive-file rules (
.env, *.key, id_rsa, secrets.*, …) with modal approval, VS Code modal approval for every destructive operation, size-limited and secret-redacted output, local metadata-only audit log.
- Public tunnels: ngrok (native binaries bundled via the official SDK; authtoken auto-discovered from your existing ngrok CLI config, or via SecretStorage / setting /
NGROK_AUTHTOKEN; static domain via NGROK_DOMAIN or the setting) or Cloudflare quick tunnel (cloudflared). At Start you pick the provider, LLMBridge then verifies the tunnel end-to-end by sending a real MCP initialize request to your own public URL — the status bar shows Connected ✓ or Tunnel unverified with the reason
- UI: activity bar sidebar (Connector panel), status bar item (Local / Connected), 12 Command Palette commands.
LLMBridge runs on Linux, macOS, and Windows (x64 + arm64 where VS Code does). Everything platform-sensitive is handled internally:
| Concern |
Linux |
macOS |
Windows |
| ngrok tunnel |
native binary bundled via SDK optional deps |
same |
same (win32 x64/arm64 binaries) |
| ngrok authtoken source |
SecretStorage → NGROK_AUTHTOKEN → setting → auto-discovered CLI config ($XDG_CONFIG_HOME/ngrok/ngrok.yml, ~/.config/ngrok/ngrok.yml, ~/.ngrok2/ngrok.yml) |
same |
same, plus %LOCALAPPDATA%\ngrok\ngrok.yml and %APPDATA%\ngrok\ngrok.yml |
| ngrok static domain |
NGROK_DOMAIN or llmbridge.ngrok.domain (all platforms) |
|
|
| Cloudflare tunnel |
cloudflared via PATH or llmbridge.cloudflared.path; preflight checks it and shows the right install command (winget on Windows, brew on macOS, GitHub release on Linux) |
|
|
run_command |
$SHELL -c (falls back to /bin/bash → /bin/sh on minimal systems) |
same |
cmd.exe /d /s /c |
start_process |
direct spawn |
same |
shell: true so npm/npx/.cmd shims resolve |
| Path confinement |
case-sensitive, symlink-checked |
same |
case-insensitive containment (VS Code vs realpath drive-letter casing) |
| Config files |
VS Code SecretStorage, $HOME |
$HOME |
SecretStorage, %USERPROFILE% |
If a tunnel can't start, the error names the exact cause (missing authtoken, cloudflared not installed, domain bind failure) and never leaves the local server broken — LLMBridge: Start always falls back to localhost with a recovery modal (Configure ngrok / Retry / Stay local only).
Install
From VSIX (recommended)
- Build the extension:
npm install
npm run compile
npm run package # produces LLMBridge-0.1.0.vsix
- In VS Code: Extensions → … → Install from VSIX → select the
.vsix
From source (development)
npm install
npm run watch # compiles on changes
Then press F5 in VS Code to launch the Extension Development Host.
Connect an AI client
- Open a folder in VS Code
- Run LLMBridge: Start (Command Palette:
Ctrl+Shift+P / Cmd+Shift+P)
- Run LLMBridge: Copy MCP Endpoint (with token, for Claude)
- In your MCP client (Claude, ChatGPT, Gemini), add a remote HTTP connector and paste the full URL with the token (
?access_token=local_…). For ChatGPT and Gemini, choose No authentication in the connector form — LLMBridge has no OAuth server, and the token in the URL is the auth
- Optional: to reach it from browser-based AI (Claude/ChatGPT/Gemini), pick a tunnel provider when prompted (ngrok / Cloudflare) or run LLMBridge: Configure ngrok first for ngrok
Step-by-step guides for every client — including ChatGPT developer mode and Gemini PRO limitations — plus token delivery options and tunnel setup are in docs/connecting.md.
Commands
| Command |
Purpose |
LLMBridge: Start |
Start the MCP server |
LLMBridge: Stop |
Stop the MCP server and tunnel |
LLMBridge: Restart |
Restart everything |
LLMBridge: Open Connector |
Open the Connector sidebar panel |
LLMBridge: Copy MCP Endpoint |
Copy http://127.0.0.1:<port>/mcp |
LLMBridge: Copy MCP Endpoint (with token, for Claude) |
Copy full authenticated URL |
LLMBridge: Copy MCP Authentication Token |
Copy token only |
LLMBridge: Regenerate Authentication Token |
Invalidate old client URLs |
LLMBridge: Configure ngrok |
Save ngrok authtoken to SecretStorage |
LLMBridge: Open Settings |
Open extension settings |
LLMBridge: View Audit Log |
Show local operation log |
LLMBridge: Clear Audit Log |
Clear the log |
Settings
| Setting |
Default |
Description |
llmbridge.mcp.requireAuth |
true |
Require MCP token on every /mcp request |
llmbridge.approvals.mode |
always |
Approval prompts for AI-triggered operations: always (prompt on every sensitive/destructive op — recommended), trusted-reads (auto-allow sensitive reads, still prompt on writes/commands), auto (no prompts). The status bar shows when the mode isn't always. |
llmbridge.mcp.port |
0 |
Local port (0 = automatic free port) |
llmbridge.maxReadFileSize |
5242880 |
Max bytes for read results |
llmbridge.maxWriteFileSize |
5242880 |
Max bytes for write contents |
llmbridge.execution.defaultCommandTimeoutMs |
120000 |
Default run_command timeout |
llmbridge.ngrok.enabled |
false |
Expose via public HTTPS tunnel |
llmbridge.public.provider |
ngrok |
ngrok or cloudflare |
llmbridge.ngrok.domain |
"" |
Optional static ngrok domain (also NGROK_DOMAIN) |
llmbridge.ngrok.authtoken |
"" |
ngrok authtoken (also NGROK_AUTHTOKEN; prefer the command) |
llmbridge.cloudflared.path |
cloudflared |
Path to cloudflared executable |
Security
LLMBridge exposes workspace files and shell execution to AI clients — treat it
as powerful and handle it with care. Full details, reporting instructions, and
known limitations: SECURITY.md.
- The server binds to
127.0.0.1 only; only POST /mcp is served.
- Tokens live in VS Code SecretStorage; every request is token-checked
(constant-time) when
requireAuth is on.
- All file paths are resolved under workspace roots only;
.. traversal,
absolute paths, and symlink escapes are blocked.
.git deletion is blocked.
- Sensitive files (
.env, *.key, id_rsa, secrets.*, …) prompt before
read/write/search and are excluded from whole-repo search.
- Destructive operations (write, create, delete,
run_command, process
control, outbound http_request) require explicit VS Code modal
approval — a remote AI client can never approve its own request.
- Command output is size-limited and common secret patterns (
api_key=…,
sk-…, xoxb-…, ghp_…) are redacted.
- Audit log records operation metadata only — never file contents or tokens.
- When you're done with a remote session: LLMBridge: Stop, or regenerate
the token.
Development
npm install
npm run compile # tsc build to out/
npm run lint # eslint
npm test # vitest unit tests
npm run smoke # end-to-end MCP smoke test (mock vscode, real HTTP session)
npm run package # vsce package
- Press F5 to debug in the Extension Development Host (config in
.vscode/launch.json).
node scripts/generate-icon.js regenerates the marketplace icon deterministically (pure Node, no dependencies).
- Publishing runs from GitHub Actions on
v* tags (Trusted Publishing via OIDC — no stored PATs).
- Contribution guidelines, commit conventions, and PR process: CONTRIBUTING.md.
- Community standards: CODE_OF_CONDUCT.md.
- Support: SUPPORT.md.
- Release history: CHANGELOG.md.
Project layout
LLMBridge/
├── src/
│ ├── extension.ts # activation, command registration, teardown
│ ├── server/mcpServer.ts # MCP server, auth, request handling
│ ├── tools/ # 29 MCP tools (files, git, terminal, …)
│ ├── security/ # path resolver, sensitive paths, redaction, audit log
│ ├── storage/ # SecretStorage-backed token / authtoken
│ ├── tunnel/ # ngrok + cloudflared tunnel manager
│ └── ui/ # status bar + connector sidebar webview
├── test/ # vitest unit tests
├── docs/connecting.md # per-client connection guides
├── .github/workflows/ci.yml # CI: compile, lint, test, package, publish on tag
└── package.json # extension manifest + npm scripts
License
MIT © 2026 BOT-HARI-01
| |