
Codelens Mcp
io.github.segentic-labPublished by GitHub account segentic-labv0.2.0Updated Oct 24, 2026
Deterministic code maps for AI agents: 7 tree-sitter tools for TS/JS/Py — map, find, function_body
Overview
A local stdio MCP server that gives assistants deterministic structural maps of TypeScript, JavaScript and Python code, so they can locate code without reading
- What you can do
- Map a whole directory tree's per-file structure in one call, skipping node_modules, dist and hidden folders.Outline a single file's imports, exports, classes and functions with line ranges.List every addressable function with signatures, types and parent scope, and read one function's verbatim source by name.Find where a function, method or class is defined across a directory, and list comments with TODO/FIXME-style markers.Report the server's version, sandbox root, supported languages and caps.
- When to use it
- Useful when an assistant works in a TypeScript, JavaScript or Python project and needs to orient itself, locate definitions or pull a single function body instead of reading whole files into context. Note the README says the project is superseded by a successor server and is no longer developed.
- Requirements
- A local Node.js 18+ runtime; the README's install steps build from source with npm and run the compiled entry point over stdio. Launch it from the project directory to be analyzed, since it only reads files under its working directory. No accounts, keys or environment variables are declared.
Installation
In SourceWeft
- Open Codelens Mcp in the dashboard and add it to a workspace.
- Enable the server for the chats that should use its tools.
Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.
Other MCP clients
Follow the launch instructions in the repository.
README
codelens-mcp
⚠️ Superseded by lens-mcp
codelens has merged into
lens-mcp— one MCP server that maps both code and markdown docs. It carries every codelens tool (map,overview,functions,function_body,comments,find,info) unchanged, plus doc tools (outline,heading,links,search) and a unifiedmapthat returns a whole project's code structure and doc outlines in one call.Use lens-mcp instead —
git clone https://github.com/segentic-lab/lens-mcp. This repo remains only so existing links resolve; it is no longer developed.(The description below is retained for reference.)
Deterministic structural code maps for AI agents. An MCP server (stdio) that gives agents the shape of a codebase — imports, exports, classes, functions, signatures, comments, TODO-markers — without reading whole files into context. Powered by tree-sitter WASM grammars: no native build step, installs anywhere Node 18+ runs.
The contract: codelens is a navigation map. Use it to locate code, then
Read the actual source before judging or modifying it. A signature is not
the body; an outline is not the section.
Tools
7 read-only tools. Every list in every response is capped, and every cap is
reported with an explicit truncated flag — no silent cutoffs.
overview, functions, and comments accept a single path or an array of up
to 20 paths per call.
Languages
Path sandbox
The server only reads files under its own working directory (the directory
it was launched from). Relative paths resolve against it; absolute paths are
accepted only if they point inside it; symlinks that escape it are rejected.
The info tool reports the root, and every rejection names it. Launch the
server from the project you want mapped.
Honesty guarantees
- A file with syntax errors is never reported as a clean success:
hasErrors: trueplusparseErrorsline ranges, because tree-sitter error-recovery can drop code near the error. - Errors set
isErroron the MCP result and return{error, path, hint}— the hint says how to fix the call. - Batch calls return per-file results plus an honest
{requested, succeeded, failed}summary;isErroronly when every file failed. - Every cap is visible:
truncatedflags carry the true totals.
Install & run
MCP client config:
For agent authors
AGENTS.md in this repo is a paste-ready guide for teaching an agent to use
these tools well — core model, per-tool tips, and the pitfalls (path sandbox,
language coverage, the map-vs-territory rule).
License
AGPL-3.0 — see LICENSE.
Source: README.md at commit 9c05ee5
Tools
0Version history
1- v0.2.0LatestSep 16, 2026
Score
50% of the applicable checks met
How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.
- Reached in the last 30 days25 pts
Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.
- Auth declared10 pts
Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.
- Tools listed15 pts
Answer tools/list without a credential, or ship a package that starts in a sandbox without one.
- DescriptionRequired15 pts
- Logo10 pts
- Documentation15 pts
- License10 pts