Home / Servers

codegraph

by lzehrung

Codegraph

Give your coding agent a map of the repository, not a pile of search results.

Codegraph is a local CLI and TypeScript library that turns a source tree into a resolved model of files, symbols, references, and dependencies. Agents and humans can ask where an implementation lives, how components connect, what a change can break, and which tests are likely relevant - then get bounded source evidence and copyable next steps.

Without structural context, an agent spends early turns listing directories, guessing search terms, opening candidate files, and reconstructing relationships in its prompt. Codegraph performs that deterministic discovery once so more of the context window can go toward understanding and changing the code.

Windows PowerShell:

irm https://github.com/lzehrung/codegraph/releases/latest/download/install.ps1 | iex

macOS or glibc-based Linux:

curl -fsSL https://github.com/lzehrung/codegraph/releases/latest/download/install.sh | sh

Then configure an agent and ask the first question:

codegraph install
codegraph explore "how does auth reach the database?" --root .

Use Codegraph alongside text search and compilers: text search finds exact strings, compilers prove language behavior, and Codegraph supplies the cross-file repository map between them. See Installation for standalone, package, and source-checkout paths.

Table of contents

What you can do

QuestionStart hereWhat comes back
"Where should I start in this repo?"codegraph orient --root . --budget smallCentral modules, a bounded tree, and copyable follow-ups
"How does this feature work?"codegraph explore "<question>" --root .Ranked anchors, source packets, dependency paths, blast radius, and likely tests
"What could this change break?"codegraph review --base HEAD --head WORKTREE --summaryChanged symbols, risk signals, candidate tests, duplicate leads, and review tasks
"What depends on this file?"codegraph rdeps src/file.ts --jsonReverse dependencies from the resolved project graph
"Where is this symbol defined or used?"codegraph goto <file> <line> <column> and codegraph refs ...Semantic definitions and references across supported languages
"Which declaration matches this name?"codegraph symbols "CodeReviewSession" --root .Ranked symbols with portable handles, exact ranges, provenance, and omissions
"What evidence do I need before a refactor?"codegraph refactor-plan <symbol-target>References, call and type relationships, candidate tests, omi

Related servers

n8n

by n8n-io

Fair-code workflow automation platform with native AI capabilities. Combine visual building with custom code, self-host or cloud, 400+ integrations.

NOASSERTION198,904

@modelcontextprotocol/server-everything

Official

by modelcontextprotocol

MCP server that exercises all the features of the MCP protocol

89,105

@modelcontextprotocol/server-filesystem

Official

by modelcontextprotocol

MCP server for filesystem access

SEE LICENSE IN LICENSE89,105

mcp-server-fetch

Official

by modelcontextprotocol

A Model Context Protocol server providing tools to fetch and convert web content for usage by LLMs

89,105