Skip to main content

Codebase knowledge graph MCP server — call chains, topology, and hybrid search for coding agents

Project description

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)
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

# Index a repo manually (optional — serve auto-indexes)
orgraph index /path/to/repo

# Check what was indexed
orgraph status /path/to/repo

# Search from the CLI
orgraph search "authentication middleware" /path/to/repo

# Start the 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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

orgraph_mcp-0.1.7.tar.gz (286.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

orgraph_mcp-0.1.7-py3-none-any.whl (175.9 kB view details)

Uploaded Python 3

File details

Details for the file orgraph_mcp-0.1.7.tar.gz.

File metadata

  • Download URL: orgraph_mcp-0.1.7.tar.gz
  • Upload date:
  • Size: 286.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for orgraph_mcp-0.1.7.tar.gz
Algorithm Hash digest
SHA256 0439355c7a9b2bce9913aea1cf537ca2a806dca014bf729c9c5c3ce665f3bd60
MD5 49da3aa6f84ad5915fdeb2537d229990
BLAKE2b-256 951e6788f91a7e1ce4ccb2544dd6ffeadc5b4658626fb50d5c62f5dd37b95ab5

See more details on using hashes here.

Provenance

The following attestation bundles were made for orgraph_mcp-0.1.7.tar.gz:

Publisher: release.yml on tss-pranavkumar/orgraph

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file orgraph_mcp-0.1.7-py3-none-any.whl.

File metadata

  • Download URL: orgraph_mcp-0.1.7-py3-none-any.whl
  • Upload date:
  • Size: 175.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for orgraph_mcp-0.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 8bb2ae4d7e2faac18cf14c3f6ede156fbecfa3689d3e282807ae922b5a83a52c
MD5 d3a80e5a252a71eedf722386cfb88e16
BLAKE2b-256 480ef0ff50b517643c0a936738072d4c3b4fc1bdf2188d53c8e27d06af78a8e2

See more details on using hashes here.

Provenance

The following attestation bundles were made for orgraph_mcp-0.1.7-py3-none-any.whl:

Publisher: release.yml on tss-pranavkumar/orgraph

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page