repo-bridge
The repo-bridge server provides 30 MCP tools that turn ChatGPT (or any LLM) into a coding agent on your own repositories, enabling file operations, code search, build/test/lint execution, git workflow, and pull request creation — all without an API key or per-token cost.
Workspace management: list, open, resume, clone remote repositories, and close workspaces.
File operations: list directories, read files (with line ranges), search code (regex/literal with glob filters), find files, write/create files, edit files using anchor-based replacement, move/rename, delete, create directories, and inspect file metadata.
Code execution: run allowed development commands (no shell, no pipes), auto-detect build/test/lint commands, and summarise failures with responsible lines for fast fix loops.
Git workflow: check status, view diffs, browse history, create/switch branches (protected branches refused), commit, push, sync, and selectively discard changes.
PR creation: open pull/merge requests on GitHub or GitLab.
Introspection & reporting: retrieve bridge capabilities/permissions (
bridge_status) and generate a summary of all session changes (report_changes).Security: sandboxed workspace, OAuth 2.1 authentication, configurable permission levels (
read_onlytofull), credential file blocking, allowlisted commands, and protected branches.Model agnostic: works with any LLM (ChatGPT, Claude, Cursor) without requiring external API keys or charging per token.
Provides tools for interacting with Git repositories, enabling status checks, diffs, logs, branch management, commits, pushes, syncs, and restores.
Allows interaction with GitHub repositories, including cloning remote repos, pushing branches, and creating pull requests.
Allows interaction with GitLab repositories, including cloning remote repos, pushing branches, and creating merge requests.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@repo-bridge Fix the failing tests in my repository and commit the changes."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
repo-bridge
Turn ChatGPT Web into a real coding agent on your own repositories — no OpenAI API key, no per-token API bill.
repo-bridge is an MCP server that gives ChatGPT — or Claude Code, Cursor, or any MCP client — real access to your codebase: read and search files, edit them, run builds and tests, drive git, push branches, open pull requests.
ChatGPT Web ──MCP/OAuth──► repo-bridge ──► filesystem · shell · git · GitHub/GitLabThe bridge never calls an LLM API. Reasoning stays in your ChatGPT session; the bridge is the execution layer. There is no OPENAI_API_KEY, no Codex/API metering, and no per-token charge added by this server — you use the ChatGPT plan you already have.
What you need
Requirement | |
ChatGPT plan | Plus or Pro. Custom MCP connectors live behind Developer mode, which gives full MCP support — read and write tools. Business / Enterprise / Edu is in beta. The free tier cannot add custom connectors, so repo-bridge does not work there. |
Model | Whatever your session runs. On paid plans that is GPT-5.6 Sol — OpenAI's strongest coding model, 272K context, with selectable Medium / High / Extra High reasoning. |
Cost | The subscription you already pay for. No |
repo-bridge is model-agnostic and contains no model logic of its own — when the model lineup changes, nothing here does.
ChatGPT asks you to confirm write actions by default. Reading and searching flow freely; edits, commands and git operations surface a confirmation first — a second pair of eyes on top of the bridge's own permission level.
What it feels like
You: Open quantix, implement portfolio drawdown alerts following the existing risk-engine architecture, run the relevant tests and fix whatever fails. Then commit on a feature branch and open a PR to develop.
repo-bridge lets the model actually do it: inspect the project, search for the code that matters, edit it, run the test suite, read the failures, fix them, re-run until green, show you the diff, commit, push, and open the pull request.
No pasting code. No copying error messages back into chat. No "here's what you should write" — it writes it, in your repo, and proves it works.
Related MCP server: DevSpace
Why this exists
Copy-paste from ChatGPT | Cloud coding agents | repo-bridge | |
Reads your real repo | ✗ | ✓ | ✓ |
Runs your build & tests | ✗ | ✓ | ✓ |
Fixes its own failures | ✗ | ✓ | ✓ |
Extra per-token API bill | ✗ | ✓ | ✗ |
Code leaves your machine | — | ✓ | ✗ |
You control what it can touch | — | ✗ | ✓ |
Your code stays on your machine (or your own VPS). The bridge only ever sees the arguments of the tool calls the model makes — never your conversation.
Features
One-call project brief.
workspace_openreturns languages, build system, the actual build/test/lint commands for that repo, module layout, git state, and yourAGENTS.md/CLAUDE.md— so a session doesn't open with a dozen exploratory reads.Autonomous test-fix loop.
run_testsresolves the right command (Maven, Gradle, npm/pnpm/yarn, pytest, cargo, go, dotnet, make…) and extracts the failure lines, so the model goes straight from "tests failed" to the responsible code.Token-efficient editing. Anchor-based
edit_filereplaces exact text instead of resending whole files — and fails loudly when the model's picture of a file is stale, instead of silently overwriting your work.Local and remote Git. Work on a repo already on disk, or clone a GitHub/GitLab repository into an isolated managed workspace per task.
Real git workflow. Branch, diff, commit, push, and open pull requests / merge requests.
Session continuity. "Continue working on quantix" resumes with branch, working-tree state, and everything the bridge changed — days later, in a new chat.
Language agnostic. Java/Spring, Node/TypeScript, React/Next.js, Python, Go, Rust, .NET, Ruby, PHP, Flutter, Android, Docker — detected from the repository, nothing hardcoded.
Security you can explain. Workspace sandbox, no shell, executable allowlist, credential files unreadable, protected branches, OAuth 2.1, full audit log.
Quick start
Requires Node.js 22+ and git. ripgrep is optional and speeds up search on large repos.
npx repo-bridge-mcp --stdioOr install it:
npm install -g repo-bridge-mcpFrom source, if you want to hack on it:
git clone https://github.com/zcrossoverz/repo-bridge.git && cd repo-bridge && npm install && npm run buildWith ChatGPT Web
cp .env.example .envGenerate the authorization passphrase, put it in .env as REPO_BRIDGE_TOKEN, set REPO_BRIDGE_AUTH=oauth, and list the repos you want reachable in REPO_BRIDGE_WORKSPACES:
node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"npm run httpcloudflared tunnel --url http://127.0.0.1:8848In ChatGPT: Settings → Connectors → Advanced → Developer mode, create a connector at https://your-tunnel/mcp, choose OAuth. Nothing to fill in — ChatGPT discovers the metadata, registers itself, and opens a browser page where you paste the passphrase once.
Full walkthrough: docs/CHATGPT.md
With Claude Code, Cursor, or MCP Inspector
REPO_BRIDGE_WORKSPACES="demo=/path/to/project" npx repo-bridge-mcp --stdioAuthentication
REPO_BRIDGE_AUTH decides who may connect; REPO_BRIDGE_PERMISSION decides what they may do. They are independent — completing an OAuth flow never raises the permission level.
Mode | Use for | How |
| ChatGPT Web, production | OAuth 2.1 + dynamic client registration + PKCE S256, per the MCP authorization spec |
| Dev tunnels, curl, MCP Inspector | Shared secret as a bearer header or |
| Loopback only | Refused on a public interface unless explicitly overridden |
ChatGPT's connector UI has no field for a custom Authorization header — OAuth is the supported path, and repo-bridge is its own authorization server so there is no third-party service to set up.
Permission levels
The level is fixed at process start. Tools above it aren't even advertised to the model, so it can't try what it isn't allowed to do.
Level | Grants |
| search, read files, inspect git |
| + create, modify, move, delete files |
| + build, test, lint, approved commands, local git (branch, commit) |
| + push, pull/merge request creation |
Tools
30 tools at full permission.
Plus an operator CLI, deliberately outside the model's reach — a model should not be able to grant or withdraw its own credentials:
repo-bridge clients # who is authorised, and how many live tokens they holdrepo-bridge revoke <id> # cut one off; it must complete consent againWorkspace — workspace_list · workspace_open · workspace_info · repo_open_remote · workspace_close
Files — list_dir · read_file · search_code · find_files · write_file · edit_file · move_path · delete_path · create_dir · file_info
Execution — run_command · run_build · run_tests · run_lint
Git — git_status · git_diff · git_log · git_branch · git_commit · git_push · git_sync · git_restore
Forge — create_pull_request
Introspection — bridge_status · report_changes
Full reference: docs/TOOLS.md
Security
The bridge assumes the model will sometimes be wrong, and that repository content may be hostile. Full model: docs/SECURITY.md
Authentication before anything else. OAuth access tokens are opaque, stored only as hashes, audience-bound to this server's URL, expiring and revocable; refresh tokens rotate on use; consent forms are HMAC-signed against CSRF.
Workspace sandbox. Confined to the configured roots. Traversal, absolute escapes and symlinks leading outside are rejected — checked against the resolved real path, not the string.
Credential files are unreadable.
.env,*.pem, SSH keys, cloud credentials, browser profiles — excluded from read and search. Commands still inherit real environment variables, so builds work without the model ever seeing the values.No shell. Commands are tokenised and spawned as argv.
;,&&,|, backticks and$( )are rejected — so text arriving from a README, a dependency, or a build log cannot chain a second process. This is the main structural defence against prompt injection.Executable allowlist. Development toolchains only. Shells,
sudo,curl/wget,ssh, registry and firewall tools are permanently blocked.Destructive operations need
confirm=true. Force push,reset --hard,git clean -fdx, recursive delete,npm publish,docker prune.Protected branches. Commits and pushes to
main/master/develop/release/*are refused; the agent uses a feature branch.Audit trail. Every tool call, file change, command and git operation is appended to
audit.log, with secrets redacted.
Verification
npm run verify224 checks, all passing — on Linux and Windows, Node 22 and 24:
Suite | Checks | What it proves |
Unit | 101 | Sandbox escapes, command policy, secret redaction, patching, gitignore/glob, symlink containment, OAuth store semantics, per-caller workspace isolation, cross-process state integrity |
End-to-end | 51 | A real git repo driven through the MCP protocol: inspect → search → read → create a failing test → run (red) → fix → run (green) → build → diff → branch → commit → push to a real remote → report |
HTTP + auth | 72 | Both auth modes, plus a full OAuth 2.1 flow: 401 challenge → metadata discovery → dynamic registration → consent → PKCE exchange → MCP over bearer → refresh → revoke — and two authorized clients keeping separate workspaces |
The suites assert the refusals too: reading .env, path traversal, command chaining, blocked binaries, committing to a protected branch, replayed authorization codes, wrong PKCE verifiers, foreign token audiences, unregistered redirect URIs.
Independently verified with the official MCP Inspector.
Known limitations
The OAuth flow is verified against the specification with a real HTTP client, not against ChatGPT's servers — confirming that end to end needs a public host and a ChatGPT account.
The bridge is its own authorization server with a single shared passphrase. Fits a self-hosted single-operator tool; it is not multi-tenant.
Each authenticated client keeps its own active workspace, but several chats inside one ChatGPT connector share it — MCP carries no conversation identity. Pass
workspaceexplicitly, or give each task its own managed workspace, when running parallel work in one connector.Live pull-request creation isn't covered by automated tests (needs a real token and repository); the code path is exercised to the API boundary.
run_commandhas no interactive stdin — use non-interactive flags.
Deployment
Shape | Notes |
Local machine | Bridge next to your repos, exposed through a tunnel. Simplest; stops when the machine sleeps. |
VPS | Bridge, repos and toolchain on a server — coding continues with your laptop closed. |
Docker |
|
See docs/DEPLOYMENT.md for systemd/NSSM services, nginx and Caddy configs, and TLS.
Documentation
Document | Contents |
Connecting ChatGPT Web, OAuth, tunnels | |
Local, VPS, Docker, TLS, running as a service | |
Threat model, boundaries, prompt injection, secrets | |
Every tool, its parameters, when to use it | |
Adding tools, architecture walkthrough | |
Symptoms, causes, fixes |
Architecture
src/
index.ts entry point; transport selection
config.ts environment configuration (the only source of permissions)
context.ts per-request caller identity, so clients stay isolated
logger.ts structured logs + append-only audit trail
auth/ OAuth 2.1 server, token store, the single request gate
security/ sandbox, secrets, capabilities, command policy
workspace/ registry, project detection, instructions, project brief
fs/ file ops, search, glob, gitignore
exec/ process runner (no shell, timeouts, smart truncation)
git/ git wrapper, status parsing, credential injection
forge/ repository refs, GitHub/GitLab REST
tools/ MCP tool definitions grouped by domain
server/ MCP server, stdio and HTTP transportsOne runtime dependency: @modelcontextprotocol/sdk. Glob and gitignore matching are implemented in-tree — a process with filesystem and execution access should carry as little third-party code as practical.
Contributing
Issues and pull requests welcome. Run npm run verify before opening one; if you add a tool that can refuse something, add the refusal to the end-to-end security checks — the tests that matter most are the ones asserting something does not happen.
Found a way around one of the boundaries above? That is a vulnerability, not an issue — see SECURITY.md for private reporting.
License
Keywords: MCP server · Model Context Protocol · ChatGPT MCP connector · ChatGPT coding agent · GPT-5.6 · GPT-5.6 Sol · GPT-5.6 Luna · AI coding assistant · autonomous coding agent · Claude Code alternative · Codex alternative · Cursor alternative · self-hosted AI developer tools · OAuth 2.1 MCP authorization · MCP dynamic client registration · PKCE · agentic coding · AI pair programming · code generation · automated testing · git automation · GitHub pull request automation · developer tools · TypeScript · Node.js · no API key required
Available Tools
27 toolsbridge_statusA
What this bridge is allowed to do: permission level, which capabilities are enabled, which executables may run, timeouts and output limits, protected branches, and whether GitHub/GitLab tokens are configured. Check this when a tool is refused, or before planning work that needs to push.
Inputs: no named parameters.
create_dirA
Create a directory (including parents). write_file already creates parent directories, so this is only needed for empty directories.
Inputs: path (required), workspace.
delete_pathA
Delete a file, or a directory tree with recursive=true. Deleting the workspace root is refused. Prefer deleting specific files over directories.
Inputs: path (required), recursive, workspace.
edit_fileA
Make targeted edits to an existing file by replacing exact text. Each edit's old_string must appear exactly once (include surrounding lines to disambiguate) unless replace_all is set. All edits are applied atomically — if any anchor fails to match, the file is left untouched and you are told why. This is the preferred way to modify code.
Inputs: path (required), edits (required), workspace.
file_infoA
Check whether a path exists and get its size and modification time, without reading it.
Inputs: path (required), workspace.
find_filesA
Find files by name or glob pattern (e.g. "**/Service.java", "**/test_.py"). Use when you know roughly what a file is called but not where it lives.
Inputs: patterns (required), path, workspace, max_results.
git_branchA
List branches, or create / switch to one. Creating a feature branch is the normal first step before making changes, since commits to protected branches are refused.
Inputs: from, name, create, workspace.
git_commitA
Stage and commit changes. By default every modified and untracked file is staged; pass paths to commit a subset. Refuses to commit on a protected branch — create a feature branch first. Write the message in the style of the repository's recent commits (check git_log).
Inputs: message (required), paths, workspace.
git_diffA
Show changes as a unified diff. against="worktree" (default, unstaged changes), "staged", "head" (staged + unstaged), or a branch/commit name to compare the current branch against it (uses the merge base). Use stat_only=true first on a large change to see which files moved before pulling in the full diff.
Inputs: paths, against, stat_only, workspace, +1 more.
git_logA
Recent commits, newest first. Useful for matching the project's commit-message conventions before committing.
Inputs: limit, range, workspace.
git_restoreA
Discard changes to specific files, or unstage them. This destroys uncommitted work, so it requires confirm=true and specific paths — it will never discard everything at once.
Inputs: paths (required), confirm (required), staged, workspace.
git_statusA
Current branch, upstream tracking, ahead/behind counts, and every staged / unstaged / untracked file. Check this before committing, and to notice user changes you did not make.
Inputs: workspace.
list_dirA
List files and directories. Use for orientation in an unfamiliar area of the repo. Build outputs, node_modules and .git are skipped automatically. Prefer search_code when you are looking for something specific.
Inputs: path, depth, limit, workspace, +1 more.
move_pathC
Move or rename a file or directory inside the workspace.
Inputs: to (required), from (required), overwrite, workspace.
read_fileA
Read a file as text. Returns exact file content (no line numbers by default) so it can be copied verbatim into edit_file anchors. For large files pass start_line/end_line, or use search_code first to find the region worth reading. Credential files (.env, keys, cloud config) are never returned.
Inputs: path (required), end_line, workspace, start_line, +1 more.
repo_open_remoteA
Clone (or refresh) a remote Git repository into an isolated managed workspace and check out a branch. Use for work on a repository that is not already on this machine. Returns the same project brief as workspace_open. Each task gets its own workspace so parallel tasks cannot interfere.
Inputs: repository (required), task, depth, branch.
report_changesA
Summarise everything done in this workspace: files changed (with per-file line counts from git), commands run and whether they passed, git operations, current branch and commit state. Use this to write an accurate final report instead of relying on memory — and to see what is still uncommitted.
Inputs: against, workspace.
run_buildA
Build the project using the build command detected from the repository (Maven, Gradle, npm/pnpm/yarn script, cargo, go, dotnet, make…). Returns exit code and output with error lines preserved even when the log is long.
Inputs: path, target, command, workspace, +1 more.
run_commandA
Run a development command in the workspace (build tools, package managers, test runners, git, language toolchains). Commands run WITHOUT a shell: pipes, redirects, && and ; are rejected — issue separate calls instead. Only allowlisted executables are permitted; destructive commands require confirm=true. Prefer run_build / run_tests / run_lint, which pick the right command for this project automatically.
Inputs: command (required), path, confirm, workspace, +1 more.
run_lintA
Run the project linter / static checks using the command detected from the repository (eslint, ruff, clippy, go vet, spotless…).
Inputs: path, target, command, workspace, +1 more.
run_testsA
Run the project test suite using the command detected from the repository. Failing output is summarised with the failure lines pulled out, so you can go straight from "tests failed" to the responsible code. This is the tool to use in an implement → test → fix loop.
Inputs: path, target, command, workspace, +1 more.
search_codeA
Search file contents across the repository and return matching lines with file:line locations. This is the primary way to find code — far cheaper than reading files. Supports literal or regex patterns, glob filters, and surrounding context lines. Respects .gitignore.
Inputs: pattern (required), path, regex, exclude, +5 more.
workspace_closeA
Stop tracking a workspace. For managed (cloned) workspaces you can also delete the directory to reclaim disk. Never deletes a local workspace's files.
Inputs: workspace (required), delete_files.
workspace_infoA
Current state of a workspace without re-reading the repository: branch, working-tree changes, recent commits, detected commands, and everything this bridge session has already changed. Use this to resume work ("continue on quantix").
Inputs: workspace.
workspace_listA
List repositories the bridge can open and which one is currently active. Call this first when you do not know what is available.
Inputs: no named parameters.
workspace_openA
Open a local repository and return a full project brief: languages, build system, detected build/test/lint commands, module layout, git state, and the repo's AGENTS.md / CLAUDE.md instructions. Accepts an alias from workspace_list or an absolute path inside a configured root. Makes the workspace active for subsequent tool calls.
Inputs: path (required).
write_fileA
Create a new file, or replace / append to an existing one. Use this for NEW files. To change part of an existing file use edit_file instead — it is safer and much cheaper than resending the whole file.
Inputs: path (required), content (required), mode, workspace.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 27 tools
The tools mostly target distinct operations—workspace management, file operations, command execution, and git actions are clearly separated. However, write_file/edit_file and run_command/run_build/run_tests/run_lint have overlapping capabilities that could cause misselection, though their descriptions and intended use cases mitigate ambiguity.
Naming follows several conventions: verb-first (read_file, run_build), domain-prefix-first (workspace_open, git_status, bridge_status), and a few irregular names like repo_open_remote and file_info. While each group is internally consistent, the lack of a single predictable pattern makes the full set harder to navigate.
27 tools is a substantial number, but the server's scope spans workspace management, file editing, command execution, and git workflows, so most tools serve a distinct purpose. The count is at the high end but not unreasonable given the breadth; still, it exceeds the typical well-scoped range.
The tool set covers the main workflows: opening and managing workspaces, reading and editing files, running builds/tests/lints, and common git operations (commit, branch, diff, status, log, restore). Minor gaps exist—no explicit push/pull (though repo_open_remote refreshes clones) and no stash or tag operations—but these are workable via run_command or are intentionally restricted.
Maintenance
Related MCP Connectors
An MCP server that gives your AI access to the source code and docs of all public github repos
Shared memory MCP server for Claude Code, Codex, Gemini CLI and Cursor. Cited, editable.
MCP server for OpenAI API (chat completions, image generation, embeddings) via AceDataCloud
Driflyte MCP server which lets AI assistants query topic-specific knowledge from web and GitHub.
Related MCP Servers
- AlicenseNot gradedqualityAmaintenanceSelf-hosted MCP server that lets ChatGPT work with your local codebase through explicit tools.MIT
- AlicenseNot gradedqualityDmaintenanceA self-hosted MCP server that gives ChatGPT a secure connection to your local machine, enabling it to read, edit, search, and run code in your projects.597 npmMIT
- AlicenseNot gradedqualityDmaintenanceA self-hosted MCP server that brings a Codex-style coding workflow to ChatGPT, allowing it to read, edit, search, and run code in your local projects.MIT
- AlicenseNot gradedqualityCmaintenanceA self-hosted MCP server that gives ChatGPT full local machine access for coding tasks, including file editing, shell commands, git operations, and project exploration via 40+ MCP tools.MIT