Mercatorgraph Docs

Configuration

Environment variables, projects.yaml, volumes, ports, tokens.

Configuration

Ports

ServicePortPurpose
worker8000webhook / rebuild / status / stats / graph.html
mcp8080agent MCP endpoint (/mcp, bearer token)
view3000human graph viewer
postgres5432internal only

Volumes

VolumeMounted atHolds
pgdatapostgres /var/lib/postgresql/dataprojects, builds, tokens, audit, annotations
graphdataworker + mcp /dataversioned graph output + current symlink

graphdata must be shared between worker (writes) and mcp (reads). Old graph versions are pruned (default: keep 5). docker compose down -v deletes volumes.

Environment variables

Postgres

VarDefault
POSTGRES_USERknowledge
POSTGRES_PASSWORDchange-meset this
POSTGRES_DBknowledge

Images

VarExample
IMAGE_PREFIXghcr.io/dimsmaul/mercatorgraph
TAG0.1.1 or latest

Worker

VarDefaultPurpose
WORKER_CORS_ORIGINS*allowed browser origins (the viewer)
DEBOUNCE_SECONDS0coalesce webhook push bursts per project (0 = off)
NOTIFY_URLPOST build.succeeded on promote (Slack-compatible)
VIEW_CONTENT_DIRregenerate viewer MDX on promote
ENCRYPTION_KEYFernet key to decrypt repo deploy keys

View

VarDefaultPurpose
WORKER_URL / PUBLIC_WORKER_URLhttp://localhost:19883browser-reachable worker URL

projects.yaml

projects:
  - slug: demo
    repo_url: https://github.com/octocat/Hello-World.git
    branch: master
    webhook_secret_ref: WEBHOOK_SECRET_DEMO   # env var with the HMAC secret
    # rebuild_interval: 3600                   # cron: seconds between rebuilds
    # deploy_key_ref: /run/secrets/demo.enc    # encrypted SSH key for a private repo

A project needs both a projects.yaml entry (how to build) and a projects table row (what's listed).

Build triggers

  • Webhook: POST /webhook/{slug} with X-Hub-Signature-256 HMAC.
  • Manual: POST /projects/{slug}/rebuild.
  • Cron: set rebuild_interval on the project.

Tokens

Stored as SHA-256 hashes. scopes is an array of project slugs or ['*']. Optional expires_at and revoked — the MCP verifier rejects expired or revoked tokens. Every tool call is audited.

On this page