Skip to main content

orgraph-mcp

Codebase knowledge graph for coding agents. Gives Claude Code, Cursor, Codex, and other MCP-compatible agents a persistent graph of any repo — call chains, topology clusters, dependency trees — on top of hybrid code search.

Quickstart

Install uv, then:

uv tool install orgraph-mcp
orgraph install

orgraph install detects installed coding agents and wires up the MCP server automatically. Open any repo in your agent and orgraph starts working — it indexes on first run, no manual setup needed.

To undo: orgraph uninstall

What agents can do

Once configured, your agent has 6 tools:

Tool What it does
search(query) Hybrid BM25+semantic search — find code by description
trace(symbol, direction, depth) Follow call chains forward (callees) or backward (callers)
find_path(from_symbol, to_symbol) Shortest call path between two named symbols
get_context(file_or_symbol) Topology cluster, community, call depth, indegree — where does this fit?
find_entry_points(kind) HTTP handlers and entry surfaces; kind = "all" | "http" | "topology"
get_dependencies(file, direction, depth) Import + call dependency tree, forward or reverse
reindex(force) Re-index changed/deleted files without restarting the server

The agent picks the right tool automatically based on what you ask.

Manual usage

All commands take a repo path as the last argument. It defaults to . so you can omit it when you're already inside the repo.

Setup

# Build the index (run once, then again after big merges)
orgraph index .

# Verify the index is healthy — node/edge counts, clusters, communities
orgraph status .

Finding code

# Find code by describing what it does — semantic + keyword search
orgraph search "coupon validation logic" .
orgraph search "order cancellation refund" . --top-k 5

# List every function and class defined in a file (table of contents)
orgraph file controllers/DiscountController.py .

# See all HTTP endpoints and async tasks in the repo
orgraph entry-points .                    # HTTP handlers (default)
orgraph entry-points . --kind tasks       # Celery async tasks
orgraph entry-points . --kind all         # both together

Understanding a function before you change it

# Who calls this function? (blast radius before editing)
orgraph who-calls get_valid_coupon .
orgraph who-calls build_order_model . --depth 2   # callers of callers too

# What does this function call? (trace the flow downward)
orgraph trace apply_coupon .
orgraph trace Coupon.on_post . --depth 3          # 3 levels deep
orgraph trace apply_coupon . --callers            # same as who-calls, tree form

# How does one function reach another? (shortest path between two symbols)
orgraph path Coupon.on_post get_valid_coupon .
orgraph path execute validateStyle . --max-hops 20

# Architectural position — how central is this, what's coupled to it?
orgraph context controllers/DiscountController.py .
orgraph context get_valid_coupon .                # works on symbol names too

context shows call depth, indegree (how many things call this), which files are tightly coupled to it, and which functions tend to change together.

Understanding file dependencies

# What does this file import? (what to read before editing it)
orgraph deps controllers/DiscountController.py .

# What imports this file? (what breaks if you delete or move it)
orgraph deps controllers/DiscountController.py . --direction imported_by

# Two levels of transitive imports
orgraph deps libs/OrderHelper.py . --depth 2

deps operates on import statements, not function calls — it shows module-level coupling, not runtime behaviour.

Typical workflow on a new codebase

# 1. Index it
orgraph index .

# 2. See all the entry points
orgraph entry-points .

# 3. Find where something lives
orgraph search "payment processing" .

# 4. See what's in that file
orgraph file controllers/OrderController.py .

# 5. Before touching a function — check blast radius
orgraph who-calls build_order_model .

# 6. Trace what it does
orgraph trace build_order_model . --depth 3

# 7. Check how central the file is
orgraph context controllers/OrderController.py .

MCP server

orgraph serve /path/to/repo

Manual MCP config

If you prefer to configure manually instead of using orgraph install:

Claude Code (~/.claude.json):

{
  "mcpServers": {
    "orgraph": {
      "command": "uvx",
      "args": ["--from", "orgraph-mcp", "orgraph", "serve", "."],
      "type": "stdio"
    }
  }
}

Cursor (~/.cursor/mcp.json):

{
  "mcpServers": {
    "orgraph": {
      "command": "uvx",
      "args": ["--python", "3.13", "--from", "orgraph-mcp", "orgraph", "serve", "."]
    }
  }
}

The server uses . as the repo path — it starts relative to wherever your agent opens the project.

How it works

  • Extraction — tree-sitter AST extractor (SCIP compiler-accurate extraction when available)
  • Graph — Kuzu embedded graph DB with Function/Class/File nodes + CALLS/IMPORTS/INHERITS edges
  • Search — semble hybrid BM25 + Model2Vec embeddings
  • Topology — BFS entry-point clustering groups files into domain clusters
  • Communities — Leiden community detection for finer-grained groupings
  • Incremental — md5 manifest tracks changes; reindex only re-extracts what changed

Eval

Measure retrieval quality against a ground truth file:

orgraph eval /path/to/repo --ground-truth queries.json --output report.json

Ground truth format:

[
  {
    "id": "auth-flow",
    "query": "how is authentication handled",
    "relevant_files": ["auth.py", "middleware.py"],
    "relevant_symbols": ["authenticate", "require_auth"],
    "query_type": "semantic"
  }
]

Reports NDCG@10, MRR, and Precision@3.

Metadata

Release files for orgraph-mcp 0.1.34

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for orgraph-mcp 0.1.34
File Size Uploaded
orgraph_mcp-0.1.34.tar.gz 484.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for orgraph-mcp 0.1.34
File Interpreter ABI Platform
orgraph_mcp-0.1.34-py3-none-any.whl Python 3 none any Details

Total release size: 853.6 kB

Release files / orgraph_mcp-0.1.34.tar.gz

Download URL orgraph_mcp-0.1.34.tar.gz
Size 484.8 kB
Tags Source
SHA-256 checksum
How to use checksums
27b1c2463cedd7048accdff6ad4c5eec1b896df062013b115c2518bdad13ffe6
BLAKE2b-256 checksum
How to use checksums
1f153cb97303d5acdbdece6f43472f61775dddf2452a541709a41f2bc27a6f70
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 23, 2026.

Transparency log

Release files / orgraph_mcp-0.1.34-py3-none-any.whl

Download URL orgraph_mcp-0.1.34-py3-none-any.whl
Size 368.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
76daaba322d6b8f99e23a7ea216223a84dd025cb919bc01027961609f239e72f
BLAKE2b-256 checksum
How to use checksums
bc9afe45029c739fcc6abcec7d45ede99b7e76b00dd01c5e7a27e2bd9917daf2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 23, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.34 This release

2 release files

0.1.32

2 release files

0.1.31

2 release files

0.1.30

2 release files

0.1.29

2 release files

0.1.28

2 release files

0.1.27

2 release files

0.1.26

2 release files

0.1.25

2 release files

0.1.24

2 release files

0.1.23

2 release files

0.1.22

2 release files

0.1.21

2 release files

0.1.20

2 release files

0.1.19

2 release files

0.1.18

2 release files

0.1.17

2 release files

0.1.16

2 release files

0.1.15

2 release files

0.1.14

2 release files

0.1.13

2 release files

0.1.12

2 release files

0.1.11

2 release files

0.1.10

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page