Atlas / MCP servers / lzehrung / codegraph

codegraphBLOCK

mcp/lzehrung/codegraph

CLI, MCP and TS library that turns source code into a map of files, symbols, references, and dependencies using tree-sitter.

Verdict
BLOCK
Grade
D
Trust score
63 /100
Exposed tools
27 24r · 3w · 0d
Transport
stdio · streamable-http
License
MIT
Stars
8
01

Overview

From the repository's own README, as read at the audited commit. Badges and raw HTML are left out.

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 map of files, symbols, references, and dependencies. Ask where an implementation lives, how components connect, what a change can break, or which tests are relevant, then get bounded source evidence and copyable next steps.

codegraph is not an AST, a compiler, or a linter. People can use codegraph review and codegraph deps to inspect changes and dependencies without an agent.

Without structural context, an agent burns early turns listing directories, guessing search terms, opening candidate files, and reconstructing relationships. codegraph does that discovery once so the context window can stay focused on the problem.

With Node.js 22.16 or newer, install from npm:

npm install -g @lzehrung/codegraph
codegraph doctor
codegraph install
codegraph explore "build review report" --root .

No Node.js or npm? The standalone installers download a se

Read from source at commit 16e94c325a14OBSERVED · 2026-10-11
Advertisement
02

Connect

Built from this server's own package name, version and transport as found in its source — not copied from anyone's documentation, so it cannot drift against a page we do not control. Replace the environment placeholders with a token scoped to the least it needs.

claude-code
claude mcp add pkg-ts-consumer --env GIT_AUTHOR_EMAIL=${GIT_AUTHOR_EMAIL} --env GIT_AUTHOR_NAME=${GIT_AUTHOR_NAME} -- npx -y @acme/[email protected]
claude-desktop
{
  "mcpServers": {
    "pkg-ts-consumer": {
      "command": "npx",
      "args": [
        "-y",
        "@acme/[email protected]"
      ],
      "env": {
        "GIT_AUTHOR_EMAIL": "${GIT_AUTHOR_EMAIL}",
        "GIT_AUTHOR_NAME": "${GIT_AUTHOR_NAME}"
      }
    }
  }
}
03

Exposed tools (27)

24 read · 3 write · 0 destructive.

ToolRiskDescription
artifact_buildwriteBuild Codegraph artifacts when write tools are explicitly enabled.
calleesreadLegacy alias for calls with direction callees.
callersreadLegacy alias for calls with direction callers.
callsreadFind proven semantic callers or callees and exact grouped callsites for a portable symbol handle. Use refs for every symbol reference and file_deps for file-level dependencies.
depsreadLegacy alias for file_deps with direction deps.
explorereadOne hybrid search plus context from top results. Not a first step; use refs or calls for known symbols.
file_depsreadList file dependencies or reverse file dependencies by file path, qualified file::symbol path, or portable handle.
get_filereadRead a bounded project file by relative path with line pagination and optional graph context.
get_symbolreadResolve a stable search or explain handle.
gotoreadResolve a definition by portable handle, qualified file::symbol path, or file position.
impactreadBuild compact impact context for a git range.
implementationsreadFind proven implementations for a type or supported interface/trait member handle without name-only inference.
orientreadBuild a compact first-turn packet for agent repo context.
packet_getreadRetrieve a bounded evidence packet by file path, symbol name, SQL object name, or stable target.
pathreadFind the shortest dependency path between two files.
query_sqlitewriteRun a bounded read-only SQL query against the graph SQLite artifact.
rdepsreadLegacy alias for file_deps with direction rdeps.
refactor_planreadBuild a read-only refactor evidence packet by symbol handle from one snapshot. Optional rename evidence is authoritative and no apply tool exists.
refresh_indexreadInvalidate the in-memory Codegraph session and optionally rebuild it.
refsreadFind references by portable handle, qualified file::symbol path, or file position.
rename_previewwritePreview a semantic rename by portable symbol handle without changing files. Filename results are suggestions only; no apply tool exists.
reviewreadBuild review context for a git range.
searchreadDeterministic ranked search across files, symbols, chunks, SQL objects, and graph context.
subtypesreadLegacy alias for type_hierarchy with direction subtypes.
supertypesreadLegacy alias for type_hierarchy with direction supertypes.
type_hierarchyreadFind proven direct or transitive supertypes or subtypes for a portable symbol handle. Returns currently extracted extends and implements relationships only.
workspace_symbolsreadDeterministic symbol-identity lookup with exact locations and filters. Use hybrid search instead for paths, prose, SQL, snippets, or graph evidence.
04

Trust audit

BLOCKgrade D · trust 63/100 Do not install this without reading the findings. The audit found something that could harm you or your machine.

LayerWhat it checksResult
L0Provenance & inventoryPASS
L1Static analysis of the codeFAIL
L2Instruction surface (what it tells the agent)PASS
L3Class-specific surfacePASS
L4Behavioural (sandbox)SKIPPED

What the source does

Filesystem
declared (11 observation(s))
Network
declared (5 observation(s))
Shell
declared (4 observation(s))
Dependencies
not all pinned
Secrets in source
none-found

Findings (25)

HIGHCode injection · code.eval_exec · CWE-78, CWE-94, CWE-95
src/sqlite-driver.ts:262
exec(sql: string): void {
Why it matters. evaluates text as code
Fix. remove; use a parser or a dispatch table
HIGHFilesystem / path · fs.credential_store · CWE-22, CWE-59
src/agent/file-view.ts:495
if (basename === ".npmrc" || basename === ".pypirc" || basename === ".netrc") {
Why it matters. touches a credential store
LOWInventory / provenance · inv.hidden_file · CWE-1104
.prettierignore
.prettierignore
Why it matters. hidden member outside the usual dotfiles
Fix. review its purpose
LOWInventory / provenance · inv.hidden_file · CWE-1104
.prettierrc.json
.prettierrc.json
Why it matters. hidden member outside the usual dotfiles
Fix. review its purpose
LOWInventory / provenance · inv.suspicious_name · CWE-1104
tests/viewer/fixtures/compact-payload.json
compact-payload.json
Why it matters. member named after an attack tool
Fix. remove or justify
LOWInventory / provenance · inv.suspicious_name · CWE-1104
tests/viewer/fixtures/legacy-payload.json
legacy-payload.json
Why it matters. member named after an attack tool
Fix. remove or justify
LOWCode injection · code.dynamic_import · CWE-78, CWE-94, CWE-95
tests/languages/python.test.ts:528
'__import__(r"pkg.builtin")',
LOWCode injection · code.dynamic_import · CWE-78, CWE-94, CWE-95
tests/languages/python.test.ts:529
'importlib.import_module(f"pkg.canonical")',
LOWInsecure crypto · crypto.weak_hash · CWE-327, CWE-338
src/indexer/build-cache/manifest.ts:314
const hash = crypto.createHash("sha1");
LOWInsecure crypto · crypto.weak_hash · CWE-327, CWE-338
src/indexer/build-cache/module-cache.ts:338
const hash = crypto.createHash("sha1");
LOWInsecure crypto · crypto.weak_hash · CWE-327, CWE-338
src/indexer/build-index.ts:811
const hash = crypto.createHash("sha1");
LOWInsecure crypto · crypto.weak_hash · CWE-327, CWE-338
src/sql/source-graph.ts:62
const hash = crypto.createHash("sha1");
LOWFilesystem / path · fs.credential_store · CWE-22, CWE-59
tests/file-view.test.ts:486
const linkedFile = path.join(root, "id_rsa");
Why it matters. touches a credential store
LOWFilesystem / path · fs.credential_store · CWE-22, CWE-59
tests/file-view.test.ts:506
const redacted = await getCodegraphFileView({ root, file: "id_rsa", limit: 10, maxBytes: 100 });
Why it matters. touches a credential store
LOWFilesystem / path · fs.credential_store · CWE-22, CWE-59
tests/file-view.test.ts:509
file: "id_rsa",
Why it matters. touches a credential store
LOWFilesystem / path · fs.credential_store · CWE-22, CWE-59
tests/file-view.test.ts:736
file: ".netrc",
Why it matters. touches a credential store
LOWFilesystem / path · fs.traversal · CWE-22, CWE-59
src/agent/query-index/content.ts:3
import { LANG_CONFIGS } from "../../bootstrap/tree-sitter-languages.js";
LOWFilesystem / path · fs.traversal · CWE-22, CWE-59
src/agent/query-index/content.ts:4
import { chunkFile } from "../../chunking/chunk-file.js";
LOWFilesystem / path · fs.traversal · CWE-22, CWE-59
src/agent/query-index/content.ts:5
import { supportForFile, supportForFileWithSource, type LanguageSupport } from "../../languages.js";
LOWFilesystem / path · fs.traversal · CWE-22, CWE-59
src/agent/query-index/paths.ts:3
import { assertFilePathWithinRoot, isAbsoluteFilePath, isFilePathWithinRoot, normalizePath } from "../../util/paths.js";
LOWFilesystem / path · fs.traversal · CWE-22, CWE-59
src/agent/query-index/schema.ts:1
import { SqliteDatabase } from "../../sqlite-driver.js";
LOWNetwork egress · net.beacon_words · CWE-200, CWE-319
tests/agent-search.test.ts:502
...Array.from({ length: fillerCount }, () => "beacon filler"),
LOWNetwork egress · net.beacon_words · CWE-200, CWE-319
tests/agent-search.test.ts:503
"quasar beacon",
LOWNetwork egress · net.beacon_words · CWE-200, CWE-319
tests/agent-search.test.ts:508
const disk = await searchCodegraph({ root, query: "quasar beacon", mode: "text", limit: 3 });
LOWNetwork egress · net.beacon_words · CWE-200, CWE-319
tests/agent-search.test.ts:511
query: "quasar beacon",

Gates applied: no_behavioural_pass.

Audited 2026-10-11 · audit v0.4.1 · source sha 16e94c325a14full audit observations/trust-audit/mcp-server/lzehrung__codegraph.json · Report an issue / request a re-scan
05

Audit history

Every audit this server has had. A grade with a past is a grade somebody is still checking.

DateSourceVerdictGradeScoreChange
2026-10-1116e94c325a14BLOCKD63first audit
06

Questions

What is the codegraph MCP server?

CLI, MCP and TS library that turns source code into a map of files, symbols, references, and dependencies using tree-sitter.

What tools does codegraph expose?

27 in total: 24 read-only, 3 that write, and 0 that can delete or overwrite. Every one is listed on this page with its risk.

Is codegraph safe to connect to an agent?

No — not without reading the findings first. The audit graded it D (63/100) and found 2 critical or high issues in the source. Each one is listed on this page with the file and line it is on.

What credentials does codegraph need?

It reads GIT_AUTHOR_EMAIL and GIT_AUTHOR_NAME from the environment. Give it a token scoped to the least it needs — an agent that can be talked into calling a tool can be talked into calling it with your credentials.

How does codegraph run?

It speaks stdio and streamable-http, so it runs as a local process your client starts. It is published on npm as @acme/pkg-ts-consumer at 1.0.0.

How current is this page?

The grade is for one exact copy of the source (16e94c325a14), read on 2026-10-11. The repository is watched and re-audited when it changes.

Advertisement