
Lens Mcp
io.github.segentic-labPublished by GitHub account segentic-labv0.1.2Updated Oct 24, 2026
Deterministic navigation maps over code + markdown + Prisma for AI agents: 13 MCP tools
Overview
A local MCP server that gives an assistant deterministic navigation maps of a project's TypeScript, JavaScript, Python, Prisma and Markdown files.
- What you can do
- Map a whole project's code structure and document outlines in one call, plus version, limits and sandbox root info and install/update status checks for the server itself. Inspect a single code file's imports, exports, classes and functions, list all functions with signatures and scope, and read one function's verbatim body. Find symbol definitions by name across a directory and list the call sites, imports and type references that use a symbol. List comments and TODO/FIXME-style markers, and outline, read, link-check and full-text search Markdown docs. Cover Prisma schemas (models, enums, fields, relations) through the overview, find and map tools.
- When to use it
- Useful when an assistant works in an unfamiliar or large repository and would otherwise spend context listing, grepping and reading whole files to find one function or the right doc section. Best for locating code and documentation quickly before reading the real source.
- Requirements
- Runs as a local stdio process on the user's machine (desktop only). Needs Node.js 18 or later; tree-sitter runs as WebAssembly, so no system packages or native build. Installed by cloning the repository and running its install script, which runs npm ci, builds and self-tests, then generates a client config. Reads only files under its working directory.
Installation
In SourceWeft
- Open Lens 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
lens-mcp
Deterministic navigation maps over code AND markdown — for AI agents. One MCP server, two lenses: tree-sitter for source (TypeScript / JavaScript / Python) and a markdown lens for docs. It answers "where is X and what's the shape of this project?" in one cheap call — so an agent spends context on thinking, not on browsing files.
Speaks the Model Context Protocol; works with any MCP client — Claude Code, Cursor, Codex, or your own agent.
Why
An agent orienting in an unfamiliar repo otherwise burns tokens ls-ing,
grep-ing, and Reading whole files to find the one function or the right
doc. lens returns the map instead of the territory:
function_bodyreads one function — often ~99% less context than Reading the file it lives in.headingreads one doc section — the referenced heading and its subsections, nothing else.mapreturns the whole project's surface — every code file's structure and every doc's outline — in a single call.
Every output is deterministic (real parsing, not a model summarizing), capped
with an honest truncated flag, and framed by one contract:
lens is a navigation map. Use it to locate, then Read the real source/section before judging or modifying it. A signature is not the body; an outline is not the section.
Tools (13)
Orientation
Code (tree-sitter — .ts .tsx .mts .cts .js .jsx .mjs .cjs .py) + Prisma (.prisma)
Docs (markdown — .md .markdown .mdx)
overview/find/map also cover Prisma schemas (schema.prisma → models, enums, fields, relations). JSON config/i18n isn't structurally mapped — lens says so honestly and points you to grep.
Call a code tool on a .md (or a doc tool on a .ts) and it fails with a
helpful pointer to the right tool — no silent confusion.
Honest by construction
- Never silent data loss — a file with syntax errors returns
hasErrors+parseErrors, still extracting what it can; unparseable files inmap/findappear with an inlineerror, never vanish. - Caps everywhere — every list is bounded (see
info.limits) and every cap is reported with the true total. A context-saving tool with unbounded output is self-refuting. - Path sandbox — only files under the server's working directory are
readable; escaping symlinks are rejected.
inforeports the root. - Errors name the fix —
{error, path, hint}, withisErrorset.
Install
One line clones, installs, and writes a ready-to-paste MCP config with this install's absolute path:
No system packages and no native build — tree-sitter runs as WebAssembly, so it
works anywhere Node 18+ runs (Linux, macOS, Windows via WSL/Git Bash). The
installer checks Node, runs npm ci, builds (tsc → dist/), self-tests the full
suite (143 tests), and generates mcp-config.json.
Register it with your client — the generated mcp-config.json looks like:
- Claude Code:
claude mcp add lens -- node /abs/path/lens-mcp/dist/index.js(or copymcp-config.jsoninto a project as.mcp.json) - Cursor / Windsurf: merge
mcp-config.jsoninto~/.cursor/mcp.json - Codex CLI: add
[mcp_servers.lens]with the same command/args to~/.codex/config.toml
lens reads files under its working directory — the project your client
launches it in. Point it at a project and call map("."). Nothing outside the
working directory is readable.
Update later, in place:
Prefer to do it by hand? npm install && npm run build && npm test, then
run node dist/index.js.
Lineage
lens-mcp supersedes the earlier split servers codelens-mcp (code) and
docslens-mcp (docs) — same engines, one server, one pipeline. Sibling of
periscope-mcp (web-app QA);
built to the same standard: honest errors, caps + truncated flags everywhere,
docs == behavior, tests before release.
Built by Segentic Lab. AGPL-3.0.
Source: README.md at commit 57d14c3
Tools
0Version history
1- v0.1.2LatestSep 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