Skip to content

Quickstart

Get Context Chain running on your codebase in under 10 minutes.

Prerequisites

  • Node.js 18+
  • Docker (for Memgraph)
  • Joern (install guide)
  • Claude CLI (claude -p, from Claude Max subscription)

1. Clone and Install

bash
git clone https://github.com/Tommylilinfeng/context-chain.git
cd context-chain && npm install

2. Start Memgraph

bash
docker compose up -d

This starts Memgraph on port 7687 and Memgraph Lab on port 3000 (http://localhost:3000).

3. Start the Dashboard

bash
npm run dashboard
# → http://localhost:3001

4. Setup via Dashboard

  1. System → Add your repo (name, path, language)
  2. System → Generate CPG (Joern code analysis)
  3. System → Full Setup (schema + import code structure)
  4. Quick Scan → Pick a repo, click Scan → decisions appear

Or Setup via CLI

bash
npm run db:schema                                         # init schema
npm run ingest:cpg -- --file data/your-repo.json          # import code structure
npm run analyze -- --repo my-repo                         # full scan
npm run mcp                                               # start MCP server

TIP

Full scan supports pause/resume: press Ctrl+C to stop, npm run analyze -- --repo my-repo --continue to resume where you left off.

5. Connect Claude Code

Add to your project's .mcp.json:

json
{
  "mcpServers": {
    "context-chain": {
      "command": "/bin/bash",
      "args": ["/path/to/context-chain/mcp-start.sh"]
    }
  }
}

Now when Claude Code works on your codebase, it can query "why was this written this way?" and get real answers.

What's Next

Released under the Apache 2.0 License.