
DevLens
io.github.devlensio由 GitHub 帳號 devlensio 發布v0.7.2更新於 Oct 30, 2026
Query a precomputed code graph (nodes, edges, summaries) of TS/JS/React/Next.js/Node repos via MCP.
概覽
DevLens 提供預先建置的程式碼圖譜,讓 AI 助理查詢排序後的文件、符號、呼叫流程、影響範圍與安全性問題,而不必逐一重讀原始碼檔案。
- 可以做什麼
- 把任務解析成受 token 預算限制的脈絡封包,含排序節點、呼叫流程與檔案片段
- 依名稱查找符號,並取得單一節點的技術、業務與安全摘要及呼叫者與被呼叫者
- 評估某個符號的變更影響,或比較兩個已分析提交之間的差異
- 管理已分析的圖譜:列出、分析、新鮮度與健康檢查
- 適用情境
- 適合助理需要反覆在 TypeScript/JavaScript、Python、Java、Go 或 Rust 儲存庫中工作,並希望以更低成本、更快地回答程式碼位置、呼叫流程、改動會破壞什麼或安全風險在哪裡的情境。儲存庫需先分析一次。
- 執行需求
- 以 npm 套件(@devlensio/cli)透過 npx 在本機以 stdio 執行,也可使用獨立二進位檔。需先用 CLI 分析儲存庫以建立圖譜與搜尋索引。AI 摘要為選用功能,需要設定 LLM 供應商、API 金鑰與端點;僅結構分析可離線執行且無需金鑰。設定存放於本機設定檔。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 DevLens,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
DevLens
Codebase Intelligence for AI agents and Developers.
Analyze your repo once. Your AI agent then queries a precomputed code graph through MCP — ranked files, call flow, impact, and security — instead of re-reading your codebase file by file. Five self-describing MCP tools, plain-text packets measured at a third of the tokens of reading the code, and the smallest response in its benchmark field.
Click the image to watch the demo
Why DevLens?
- Your agent stops burning tokens. One MCP call returns a task-shaped packet — the files and symbols that matter, ranked, within a token budget. No grep loops, no re-reading files.
- It wins the benchmark. First of nine tools on correctness, F1, recall, and precision — the only tool that leads every quality column.
- It is fast and small. 67 ms per call, packets 6.7× smaller than the closest graph competitor, and it never exceeds the token budget you set.
- Developers get it too. Interactive graph visualization, blast radius before you change a symbol, PR review packets, and per-node security analysis.
Benchmarks
We benchmarked DevLens MCP against the other code graph and retrieval tools — Graphify, codegraph, semble, bm25 — on one headless coding agent, one model, one real TypeScript repository, and 133 real questions written from actual pull requests and symbols:
Head-to-head against Graphify — the most direct competitor (tree-sitter graph, MCP server) — DevLens wins on every axis: correctness in the agent loop (0.643 vs 0.619, same run) and in the retrieval layer (0.694 vs 0.662, paired 15 wins to 9 losses on identical questions), a 6.7× smaller packet (2,230 vs 15,020 tokens, smaller on all 54 of 54 comparable questions), and ~37× faster per call (67 ms vs 2,469 ms). Graphify's graph is also 64% larger with 3.6× the edges (16,999 nodes / 71,694 edges vs 10,346 / 19,847) for the lower quality.
The pattern behind the numbers: syntactic tools return big blobs or bare line lists. DevLens returns a task-shaped packet from a type-resolved graph — the files that matter, ranked, within your token budget, in milliseconds.
Full methodology, per-type tables, and the nine-tool round: docs/PUBLIC-BENCHMARKS.md
How DevLens compares
DevLens is the only tool in this space that combines native semantic parsing, per-node AI summaries with per-node security analysis, and framework-aware data edges — and the only option you can use commercially under AGPL.
(Feature comparison from public sources, Aug 2026.)
Why teams choose DevLens: semantic edges that syntactic tools cannot produce, per-node security analysis no other open-source tool provides, benchmark-winning retrieval quality, and a single MCP front door — free for commercial use.
Quick Start
Step 1 — Install the CLI
Or install the standalone binary (no Node.js needed):
Step 2 — Configure a model (optional)
Only needed if you want AI summaries. Structure-only analysis works offline with no API key.
This walks you through picking a provider, API type, key, endpoint, and model interactively — press ESC at any step to go back a stage. See Configuration for recommended models.
Step 3 — Analyze your repo
This builds the graph, generates summaries, and creates the search index — once. After this, everything below is instant.
Step 4 — Connect your AI agent
Start the MCP server:
Then register it in your agent. Pick your tool:
Claude Code / Claude Desktop
Cursor — add to .cursor/mcp.json:
Codex — add to ~/.codex/config.toml:
Hermes — add to config.yaml:
Any other MCP client — the server speaks standard MCP over stdio. Point your client at the command devlens mcp. For an HTTP transport instead:
The server self-describes its full tool list through tools/list, so your agent discovers everything on its own. That's it — ask your agent "how does auth work in this repo?" and watch it query the graph instead of reading files.
What your agent can ask
The server self-describes every tool's parameters through tools/list — your agent fills them in automatically. Five tools, no graphId anywhere — the repo is resolved from your working folder.
Every response carries a provenance block (commitHash, analyzedAt, hasGit), so your agent always knows which snapshot answered the question.
Full reference:
docs/mcp-reference.md
Supported languages
DevLens parses five language families with native parsers (no AI, no regex, no tree-sitter) and understands their frameworks. Summaries are never generated silently: you confirm before tokens are spent, and structure-only analysis needs no provider at all.
Each repo is analyzed with its language's own parser (Python ast, JavaParser, Go go/ast plus go/types, Rust syn, TS compiler API), so edges are real: type-checked interfaces (IMPLEMENTS), framework routes (HANDLES), and ORM data layers (READS_FROM, WRITES_TO).
For developers: the Web UI
For when you want to see your codebase laid out as an interactive graph.
Open the Web UI, paste your repo path, and explore a force-directed canvas. Click any node to see its summaries, callers, callees, and security flags. Search, filter, and diff commits across versions. The Project panel shows search index readiness with a one-click reindex action.
The Web UI runs from the source tree, it is not bundled into the installed CLI binary.
CLI
For scripts, CI, and fast answers without leaving the terminal. Every command supports --json for piping into scripts, -v/--verbose for diagnostics, and --quiet for minimal output.
Analyze and summarize
Explore and understand
Impact and quality
Manage and integrate
Hands-on examples
Full reference:
src/cli/README.mdfor every command with options and examples.
How to summarize
Summaries are per-node AI descriptions that make querying much richer. Run them during analysis, or any time later:
When a repo is re-summarized, only nodes without summaries are processed, so tokens are not spent twice. Configure your provider once with devlens init.
Configuration
Config lives in ~/.devlens/config.json, set via devlens init or devlens config. Models are discovered dynamically from each provider's /models endpoint, so there are no hardcoded model lists — pick whatever fits your budget and quality bar.
What DevLens understands
A graph is per repo and per language. Node types include FILE, FUNCTION, METHOD, CLASS, INTERFACE, STRUCT, ENUM, TRAIT, IMPL_BLOCK, ROUTE, COMPONENT, HOOK, STATE_STORE, UTILITY, TEST, STORY, and THIRD_PARTY (language dependent). Every node carries an importance score plus its functional, technical, and security summaries once summarized.
Edge types (the connections the graph draws): CALLS, IMPORTS, READS_FROM, WRITES_TO, PROP_PASS, EMITS, LISTENS, WRAPPED_BY, GUARDS, HANDLES, TESTS, USES, NEXTJS_API_CALL, NAVIGATES_TO, IMPLEMENTS (class to interface, trait, or ABC), EXTENDS (class to base class). EXPORTS, THROWS, MODULE, and PACKAGE are reserved for future languages.
Router awareness: routes are real graph nodes, for Next.js (app and pages), React Router, TanStack Router, wouter, Express, Fastify, Hono, Koa, Django URLconf and DRF, Flask blueprints, @RestController (Spring), Gin, Echo, chi, plain HTTP handlers, axum, actix, and rocket.
Search index
Each analyzed commit gets a derived BM25F search index next to the graph, at ~/.devlens/graphs/<graphId>/commits/<commitHash>.search.json.
- Every
devlens analyzeanddevlens summarizerebuilds the index for the commit it produced, so search is ready immediately. - Graphs built by older DevLens versions have no index. They are indexed lazily on the first search, or you can index everything up front with
devlens reindex. - The index is derived data: deleting it is safe, it rebuilds on demand.
The same operations are available over HTTP: POST /api/reindex and POST /api/reindex/:graphId?commitHash=...&force=1.
Screenshots
Graph explorer · node inspector with summaries and security risk · focused subgraph · security findings
Why it's fast and cheaper
A node summary is roughly 50 tokens. The file it describes is roughly 2,000. Querying summaries and graph slices costs a fraction of reading files, so humans get answers faster and AI agents spend dramatically fewer tokens on the same task.
Who is this for
- Developers and teams: onboard in hours not weeks, review PRs with impact context, catch circular dependencies and god-files, keep living documentation.
- Engineering leaders: a bird's-eye architecture view, spot debt before it becomes a crisis.
- AI-augmented developers: stop letting your agent burn tokens re-reading files; it queries the graph instead.
Repository layout
The analysis engine (native parsers and graph build) ships as the separate devlensio package.
DevLens Cloud
A hosted version is in development: shareable graphs, team workspaces, live per-commit documentation with node summaries, detailed PR analysis (summary, impact, security), commit diffs showing added/modified/deleted nodes, an AI-native chat over your codebase, and no local setup.
License
AGPL-3.0. Part of the devlensio family of tools.
來源:README.md,提交 61dcc6f
工具
0版本歷史
5- v0.7.2最新Oct 29, 2026
- v0.7.0Oct 4, 2026
- v0.6.1Oct 1, 2026
- v0.6.0Sep 30, 2026
- v0.5.5Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分