DevLens

v1.0.2
io.github.devlensio/devlens Checked 16 hours ago Published 11 days ago

Query a precomputed code graph (nodes, edges, summaries) of TS/JS/React/Next.js/Node repos via MCP.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

resolve_context

Start here when you need to LOCATE a symbol or EXPLAIN how something works. One call returns a task-shaped packet: ranked nodes with one-line meanings, call flow in execution order, involved files, code bodies of the top 10 nodes, security flags, and an id map, within a token budget. FLOW edges carry the position inside the caller: -calls[#3]-> (repeats as [#1,#3]), executed-after-return as -calls[defer:X]->, parallel as -calls[conc]->, plus at=file:line for the real call site, so you do not need a second call to establish what runs in what order. NOT the right tool for dependency or impact l…

ParameterTypeDescription
task *stringThe actual question or task, in plain words
commitHashstringDefaults to latest analyzed commit
focusarraynodeIds, symbol names or filePaths to center the packet on
intentstringDefault exploratory
repoPathstringOnly needed when several repos are analyzed and the working folder is ambiguous
tokenBudgetnumber500..100000; default scales with repo size. Code bodies ride on top of this budget.

find_symbols

Cheap symbol lookup by name, path fragment, or concept words (lexical BM25F). Returns ranked nodeIds with path:line refs — no code, no structure. Use it to locate a symbol; use resolve_context when you need meaning, flow, or code.

ParameterTypeDescription
query *stringSymbol name, identifier, path fragment, or concept words
commitHashstring
limitnumber1..25, default 10
repoPathstring
summaryTypestringWhich summaries to weight in ranking, default both

get_node

Full detail for ONE node: technical/business/security summaries, callers (who uses it), callees in execution order (what it calls, with #n, line and control-flow markers such as await, defer:X, conc, repeat, maybe), and its own call sites. Pass a nodeId from resolve_context/find_symbols, or a symbol name to auto-locate. include=['code'] adds the raw source (first 120 lines; page with codeLines=[start,end]). Prefer this over reading whole files.

ParameterTypeDescription
node *stringnodeId, or a symbol/file name to locate first
codeLinesarrayWith include:['code'] — absolute 1-based [start, end] file lines. Defaults to the first 120 lines of the node; max 400 per call. Follow the banner's next hint to page.
commitHashstring
edgeTypesarrayRestrict callers/callees to these edge types
includearrayDefault: summaries + callers + callees. Add 'code' for raw source.
repoPathstring

blast_radius

Use this for EVERY dependency or impact question: who calls X, who uses X, who imports X, what depends on X, what breaks if X changes, every reference to X, callers/consumers of X. It returns the COMPLETE reachable set as compact file:line refs, not a ranked neighbourhood, which is why it answers these questions when resolve_context cannot. Default direction is UPSTREAM (the dependents that break); direction='downstream' is what X itself depends on. radius controls hops (default 2; hub-fanout auto-caps at 1 unless explicit). Pass from+to commit hashes instead of a target to diff two analyzed c…

ParameterTypeDescription
commitHashstring
diffRadiusnumberBlast-radius hops for changed nodes in diff mode. Default 1.
directionstringDefault upstream (who depends on it). 'both' runs both traversals.
fromstringOlder commit hash — commit-range diff mode
radiusnumberHops. Default 2, capped at hub fanout; explicit value is uncapped.
repoPathstring
targetstringnodeId, symbol name, or file path (required unless from/to given)
tostringNewer commit hash — commit-range diff mode

repo

Manage analyzed graphs. action='list' shows analyzed repos (one line each); action='analyze' indexes a repo folder (run once per repo, or after large structural changes); action='freshness' compares the graph to the current HEAD; action='health' reports summary coverage and circular-dependency groups. Repo resolved from the working folder when omitted.

ParameterTypeDescription
action *stringlist | analyze | freshness | health
isGithubRepobooleanFor analyze: path is a GitHub URL
pathstringFor analyze: local repo path (or GitHub URL with isGithubRepo=true)
repoPathstringFor freshness/health: disambiguate the graph