code-graph

io.github.cyberchronos00由 GitHub 账号 cyberchronos00 发布v0.23.13更新于 Oct 25, 2026

本地依赖图:调用方、入口点以及变更影响范围的file:line证据。

AI 翻译由 AI 模型根据下方的原文描述翻译,可能有误。

原文描述

Local dependency graph: callers, entry points and file:line evidence for what a change affects.

已验证STDIO仅桌面

概览

code-graph 的本地 MCP 服务;无需登录;STDIO。

暂无 AI 概览:以下信息来自注册中心条目和服务本身。

安装

在 SourceWeft 中

  1. 打开 控制台中的 code-graph,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

code-graph

See everything a change affects before you make it: a local, deterministic dependency graph of routes, calls, tables and config, with file:line evidence for every hop.

For you and your AI agent (CLI + MCP). No LLM in the graph.

[PyPI] [Downloads] [Python 3.11+] [License: MIT] [Docs]

Docs · Quick start · CLI · MCP · Changelog

[cg visual view: the graph around the warehouse connection, a selected node with its evidence paths and source, then the planned-change overlay for the preorders plan]

Quick start

bash
pipx install cg-code-graph          # or: uv tool install cg-code-graphcg index . --db out/graph.db        # prints starter queries for your repocg install --host cursor    # or claude, codex, vscode, …: registers the MCP server and a "use cg first" agent rulecg reaches table:orders --db out/graph.db   # any table, connection or config key

Try it on a bundled sample, link a frontend to a backend, or connect an agent over MCP: Quick start guide. Other install options (install.sh, Windows, exact-mode toolchains): Install.

cg reaches table:store_books on the bundled Django sample:

text
dependents: 18 nodes  (code: 6, entry points: 9, other: 3)== RUNTIME (reached from http_route / ... / queue_job / listener): 5 functions/methods    catalog.api.create_book  depth=1 conf=resolved  http_route(1)        path: function:catalog.api.create_book          -WRITES_TABLE[resolved @ catalog/api.py:27]-> table:store_books    catalog.signals.review_saved  depth=3 conf=resolved  listener(1)        path: function:catalog.signals.review_saved          -DISPATCHES[exact @ catalog/signals.py:12]-> job:catalog.tasks.recompute_rating          -HANDLED_BY[exact @ catalog/tasks.py:13]-> function:catalog.tasks.recompute_rating          -READS_TABLE[resolved @ catalog/tasks.py:14]-> table:store_books

[Terminal demo: cg indexes the bundled Laravel and Nuxt sample apps, links them, then runs reaches, path, impact and plan check]

Supported languages

LanguageFrameworks and factsCallsDocs
[Python]Django (+ DRF, django-ninja), FastAPI / Starlette, Flask, Celeryexact (stdlib ast)Python
[TypeScript] [JavaScript]Nuxt / Vue, NestJS, Next.js, Astro, Express, Fastify, Koa, Hono, Elysia, React Router / Remixexact (TypeScript compiler API)TS frameworks
[PHP]Laravel (routes, route attributes, middleware, queues, broadcasting, outbound HTTP)exact (nikic/php-parser; needs PHP 8.2+)PHP
[Dart]Flutterexact (Dart analyzer; needs the Dart SDK)Platforms
[Kotlin]Android, Kotlin Multiplatform, Springheuristic; exact with scip-java (opt-in)Kotlin
[Java]Spring (routes, guards, beans, tables, clients)heuristic; exact with scip-java (opt-in)Java
[Swift]iOS / SwiftPMheuristic; exact with the Swift index store (opt-in)Swift
[Rust] [C] [C++]crates / modules, entry points, FFI, #[cfg] / #if gatesheuristic; exact with rust-analyzer / scip-clangRust, C and C++

Go and others: import a SCIP index with cg index --scip FILE. Run cg doctor to see exact / heuristic per language on your machine.

What you get

  • reaches, impact, path: every caller, route, job and page that reaches a table, config key or method.
  • cg affected --base main: the tests and entry points a change reaches (--quiet feeds your test runner).
  • Across repos: cg link matches client HTTP calls (frontends and Laravel / Guzzle backends) to server routes, and checks request keys (Laravel FormRequest, Elysia schemas, Nuxt / TypeScript bodies).
  • Route guards: cg routes --writes --unguarded lists routes that write with no auth guard. Laravel checks inside the action count as inline guards unless --strict.
  • Security views: cg surface lists the inbound / outbound attack surface and findings (hardcoded credentials, plaintext protocols, unverified webhooks, unguarded handlers, listeners on all interfaces, disabled TLS / SSH verification, plaintext gRPC, exposed IPC, outbound URLs built from request input) as text, JSON or SARIF, with --fail-on for CI.
  • MCP server (cg-mcp) so agents query the graph instead of grepping. One server can serve many graphs (graphs plus an optional graph argument); a single --db stays one graph. See MCP.
  • Visual view (cg serve) and plan checks (cg plan check) for planned changes.

Docs

Install · Quick start · CLI · MCP · Configuration · Architecture · Limitations

Changelog · Contributing · Security · MIT License

More recordings: docs/media.

来源:README.md,提交 00f41a5

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

6
  1. v0.23.13最新Oct 20, 2026
  2. v0.23.12Oct 19, 2026
  3. v0.23.10Oct 19, 2026
  4. v0.23.6Oct 17, 2026
  5. v0.23.3Oct 17, 2026
  6. v0.23.2Oct 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分