Powered by Narsil MCP

Dense, Lossless Context for AI Coding Agents

Generate, share, and store layered code context graphs for arbitrarily large repos. Lightning-fast Rust performance with oxigraph SPARQL/RDF backend.

Terminal

$ brew tap postrv/narsil && brew install narsil-mcp

$ narsil-mcp --repos ~/your-project --ccg-output ./context.ccg.json

90 Tools
32 Languages
SPARQL/RDF
100% Local

AI coding agents are flying blind

Without deep code intelligence, AI assistants struggle with complex codebases

AI agents lose context in large codebases
Layered context graphs preserve full semantic structure
Manual context curation is slow and error-prone
Auto-generated graphs capture everything
Context windows overflow with naive approaches
Dense, lossless compression via RDF triples
Agents can't discover unfamiliar open source repos
Share CCG files for instant agent onboarding

Complete context. One graph file.

Everything your AI assistant needs to understand your codebase

Layered Context Graphs

Multi-layered representation capturing symbols, call graphs, types, and dependencies.

Semantic Search

BM25 + TF-IDF + neural embeddings. Find code by meaning, not just text.

Security Analysis

OWASP Top 10, CWE Top 25, secrets detection, taint analysis baked in.

Full Call Graphs

Who calls what? Trace paths between functions. Find hotspots instantly.

Dependency Intelligence

SBOM generation, OSV vulnerability checks, license compliance.

Type Inference

Infer types in Python/JS/TS without running external checkers.

SPARQL/RDF Backend

Powered by oxigraph. Query your codebase like a knowledge graph.

Shareable Graphs

Export, publish, and share CCG files. Let agents adopt your repo instantly.

Rust Performance

Lightning-fast indexing and querying. Handle million-line codebases.

Git Integration

Blame, history, hotspots, contributors — all queryable.

32 Languages

Rust, Python, TypeScript, Go, Java, C#, Ruby, Kotlin, Swift, and 23 more.

100% Local

Your code never leaves your machine. No cloud required.

From install to insights in 60 seconds

Get started with Code Context Graph in three simple steps

1

Install

$ brew tap postrv/narsil
$ brew install narsil-mcp
# Or cargo, npm, scoop, nix...
2

Generate CCG

$ narsil-mcp \
  --repos ~/your-project \
  --ccg-output ./context.ccg.json
# Creates layered context graph
3

Use with AI

# Share with agents or configure MCP
{
  "mcpServers": {
    "narsil": {
      "command": "narsil-mcp",
      "args": ["--repos", "~/project"]
    }
  }
}
Open Standard

The CCG Standard

Publish your codebase for AI

The Code Context Graph (CCG) is an open standard for publishing machine-readable code intelligence. Dense, lossless, and designed for AI consumption.

  • Symbols, call graphs, types, security findings — all in one file
  • Works with any LLM, any MCP client
  • Auto-generated by narsil-mcp, hosted on codecontextgraph.com
  • Open standard — contribute via GitHub
Code Context Graph
{
  "@context": "https://codecontextgraph.com",
  "@type": "CodeContextGraph",
  "name": "my-project",
  "version": "1.0.0",
  "layers": {
    "symbols": { ... },
    "callGraph": { ... },
    "types": { ... },
    "dependencies": { ... },
    "security": { ... }
  }
}