feat: Add Dockerization Strategy and MCP SSE support#82
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ed24e77ffb
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
|
||
| EXPOSE 8045 | ||
|
|
||
| ENTRYPOINT ["supergateway", "--port", "8045", "--stdio", "codegraph serve --mcp"] |
There was a problem hiding this comment.
Start the repository’s actual MCP command
For every image built from this Dockerfile, the entrypoint delegates to codegraph serve --mcp, but the tracked CLI defines start as its MCP-server command and has no serve subcommand (repo-wide search of the Rust CLI finds only codegraph start stdio/http). Moreover, the image installs a separately published npm package rather than building this repository, so it cannot run the reviewed server revision; build the repository binary and invoke its supported stdio command, or pin and validate a package whose CLI actually provides this invocation.
Useful? React with 👍 / 👎.
| # Run this from the root of the project you want to index | ||
| docker-compose up -d | ||
| ``` | ||
| *Note: This will index the current directory `.` by mounting it to `/repo` inside the container.* |
There was a problem hiding this comment.
Make the quick-start Compose invocation address the target project
The documented command cannot deliver the promised mount: after cloning this repository, running docker-compose up -d from the project root finds no Compose file because it lives in docker/; copying only the Compose file instead makes build: . look for a Dockerfile in the target project. Even when run from docker/, Compose resolves the .:/repo bind source relative to that Compose file, so it mounts the docker directory rather than the repository the note says will be indexed. Provide a self-contained template or explicit file/build paths and a configurable target-directory bind mount.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Pull request overview
Adds a self-contained docker/ bundle to run CodeGraph headlessly as an MCP server behind an HTTP SSE endpoint, plus a helper script to wire multiple agent clients to that endpoint.
Changes:
- Adds a Docker image (Node +
@colbymchenry/codegraph+supergateway) exposing SSE on port8045. - Adds a
docker-compose.ymltemplate to run the container and persist the.codegraphcache. - Adds docs and a wiring script to inject MCP SSE config into multiple agent config files.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| docker/Dockerfile | Builds a Node-based image installing CodeGraph + supergateway and exposing port 8045. |
| docker/docker-compose.yml | Defines a service to run the MCP SSE container and mount/persist indexing state. |
| docker/wire-clients.sh | Automates injecting an SSE-based MCP server entry into various agent config files. |
| docker/README.md | Documents quick-start usage and supported clients for the dockerized MCP SSE setup. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| jq --arg url "$SSE_URL" '.mcpServers.codegraph = {"type": "sse", "url": $url}' "$target" > "$target.tmp" && mv "$target.tmp" "$target" | ||
| echo "✅ Wired CodeGraph SSE for $agent -> $target" |
| SSE_URL="${1:-http://localhost:8045/sse}" | ||
| REPO_ROOT="${2:-$PWD}" |
| # Mount the current repository (or any target repository) into the container | ||
| - .:/repo | ||
| # Persist the CodeGraph index so it doesn't rebuild on container restart |
| 2. **Start the container**: | ||
| ```bash | ||
| # Run this from the root of the project you want to index | ||
| docker-compose up -d | ||
| ``` |
| 3. **Wire your agents**: | ||
| Use the included script to automatically inject the MCP server configuration into your agents' global settings. | ||
| ```bash | ||
| ./wire-clients.sh | ||
| ``` |
This PR adds a standalone Docker containerization strategy in the
docker/directory to run CodeGraph headlessly as an MCP server using an SSE (Server-Sent Events) transport.Why?
Running CodeGraph natively requires Node.js (or downloading binaries) which can be a point of friction when distributing to a team of junior developers. This allows anyone on a team to easily index their repository and connect their AI coding agents by simply running
docker-compose up -d.What's included?
@colbymchenry/codegraphalongsidesupergatewayto proxy thestdiostream to a stable HTTP SSE endpoint. Also disables the handshake timeout so the container can run in the background indefinitely without crashing while waiting for clients..codegraphcache.jq) into global agent settings (Cursor, VSCode, Cline, Roo, Claude Code, etc).This gives teams a completely OS-agnostic, frictionless way to adopt CodeGraph!