There are two ways to run codebadger:
- A — Full stack with Docker (recommended). One command brings up the MCP server + Joern + Postgres + Redis as containers. Best for production and the quickest way to get a working server.
- B — Local development. Run the backing services in Docker and the MCP server from your Python checkout, for iterating on the server itself.
- Docker Engine + the Compose v2 plugin — install: https://docs.docker.com/engine/install/
- Permission to use the Docker socket (deploy user in the
dockergroup, or root) - A host dedicated to codebadger — the MCP container mounts the Docker socket (root-equivalent on the host; see Deployment → Trust boundary)
docker --version && docker compose versiongit clone http://github.com/lekssays/codebadger && cd codebadgercp .env.example .envEdit .env and set at least:
PLAYGROUND_HOST_PATH— absolute path to./playground(e.g./opt/codebadger/playground). Required so per-CPG worker containers, started via the host daemon, bind the right directory.MCP_HOST—0.0.0.0to expose on all interfaces, or127.0.0.1if a reverse proxy fronts it.
Then size memory for your host (RAM is the binding constraint) and copy the
suggested values into .env:
python scripts/recommend_config.py # prints JOERN_MEM_LIMIT / JOERN_MEMORY_BUDGET_MBNo Python on the host? Skip this and start with the
.env.exampledefaults (JOERN_MEMORY_BUDGET_MB=0auto-derives from host RAM); tune later.
./scripts/deploy.sh # builds images, starts the stack, waits for /health./scripts/deploy.sh status
curl -s http://localhost:4242/health | python3 -m json.tool
# -> {"status":"up","mcp":"codebadger","dependencies":{"joern":"up","postgres":"up","redis":"up",...}}The MCP endpoint is at http://<host>:4242/mcp, health at /health.
See Deployment for day-2 operations (logs, restart, upgrade, backups), worker modes, and scaling to large batches.
Run the backing services in containers but the MCP server from your checkout.
- Docker Engine + Compose v2 (as above)
- Python 3.10+ (3.13 recommended)
docker --version && docker compose version && python --versionpython -m venv venv && source venv/bin/activate
pip install -r requirements.txt--scale codebadger-mcp=0 brings up Joern + Postgres + Redis without the MCP
container, so it doesn't collide with the one you run on the host:
docker compose up -d --scale codebadger-mcp=0
docker compose ps # codebadger-joern-server / -postgres / -redis upcp config.example.yaml config.yamlIt defaults to the Compose Postgres (localhost:55432) and Redis
(localhost:56379) and creates the Postgres schema on first start, so no extra
env is needed:
python main.pyPostgres and Redis are required — the server exits with a clear error if either is unreachable.
main.pydoes not read.env; setJOERN_MEM_LIMITetc. in your shell if you need to override them.
curl -s http://localhost:4242/health | python3 -m json.tool- Connect a client and run your first analysis → Usage
- Production deployment, scaling, worker modes → Deployment
- Tune memory, ports, telemetry → Configuration
bash cleanup.sh # clears codebases, CPGs, and Postgres/Redis state
docker compose down # stop & remove containers (playground/ + pgdata/ persist)