Skip to content

feat: Add Dockerization Strategy and MCP SSE support#82

Open
delorenj wants to merge 1 commit into
Jakedismo:mainfrom
delorenj:feat/mcp-docker-sse
Open

feat: Add Dockerization Strategy and MCP SSE support#82
delorenj wants to merge 1 commit into
Jakedismo:mainfrom
delorenj:feat/mcp-docker-sse

Conversation

@delorenj

Copy link
Copy Markdown

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?

  1. Dockerfile: Packages @colbymchenry/codegraph alongside supergateway to proxy the stdio stream 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.
  2. docker-compose.yml: A ready-to-use template that mounts the local directory into the container and persists the .codegraph cache.
  3. wire-clients.sh: A script to effortlessly inject the SSE configuration (using jq) into global agent settings (Cursor, VSCode, Cline, Roo, Claude Code, etc).

This gives teams a completely OS-agnostic, frictionless way to adopt CodeGraph!

Copilot AI review requested due to automatic review settings July 16, 2026 19:20

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread docker/Dockerfile

EXPOSE 8045

ENTRYPOINT ["supergateway", "--port", "8045", "--stdio", "codegraph serve --mcp"]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Comment thread docker/README.md
Comment on lines +12 to +15
# 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.*

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 port 8045.
  • Adds a docker-compose.yml template to run the container and persist the .codegraph cache.
  • 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.

Comment thread docker/wire-clients.sh
Comment on lines +29 to +30
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"
Comment thread docker/wire-clients.sh
Comment on lines +12 to +13
SSE_URL="${1:-http://localhost:8045/sse}"
REPO_ROOT="${2:-$PWD}"
Comment thread docker/docker-compose.yml
Comment on lines +10 to +12
# Mount the current repository (or any target repository) into the container
- .:/repo
# Persist the CodeGraph index so it doesn't rebuild on container restart
Comment thread docker/README.md
Comment on lines +10 to +14
2. **Start the container**:
```bash
# Run this from the root of the project you want to index
docker-compose up -d
```
Comment thread docker/README.md
Comment on lines +17 to +21
3. **Wire your agents**:
Use the included script to automatically inject the MCP server configuration into your agents' global settings.
```bash
./wire-clients.sh
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants