Deterministic navigation maps over code + markdown for AI agents: 11 MCP tools (TS/JS/Python)
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β or use 1-click editor setup below.
π‘ Paste the JSON block into your client's configuration file under mcpServers, then restart the application.
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.
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_body reads one function β often ~99% less context than Reading
the file it lives in.heading reads one doc section β the referenced heading and its
subsections, nothing else.map returns 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.
| Tool | What it does |
|---|---|
map | Whole-tree surface in one call: per code file β structure; per doc β title + outline. Both families, one response. |
info | Version, sandbox root, supported languages/extensions, tool list, every output cap, and the lens contract. |
lens_system | Install status, self-update (update.sh under the hood), and fetch the current AGENTS.md β lens's self-maintenance tool. |
.ts .tsx .mts .cts .js .jsx .mjs .cjs .py) + Prisma (.prisma)| Tool | What it does |
|---|---|
overview | One file's imports, exports, classes (+ methods), top-level functions, with line ranges. |
functions | Every function incl. nested β signatures, params/types, parent scope, kind. |
function_body | Verbatim source of ONE function β the focused read. |
comments | Comments + TODO/FIXME/BUG/HACK/β¦ markers (markersOnly for the debt list). |
find | Locate a definition by name β functions, classes, and now const/type/enum/exports β across a directory. |
references | The inverse: who uses a symbol β call sites, imports, type-refs β tree-sitter-precise, no grep false positives. |
.md .markdown .mdx)| Tool | What it does |
|---|---|
outline | Full heading hierarchy (the TOC) with line numbers. |
heading | Read ONE section by heading text / slug / line number. |
links | Extract inline / image / wikilink / autolink / reference links. |
search | Case-insensitive full-text search across docs (heading hits ranked first). |
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.
hasErrors +
parseErrors, still extracting what it can; unparseable files in map/find
appear with an inline error, never vanish.info.limits) and every cap
is reported with the true total. A context-saving tool with unbounded output
is self-refuting.info reports the root.{error, path, hint}, with isError set.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 mcp add lens -- node /abs/path/lens-mcp/dist/index.js
(or copy mcp-config.json into a project as .mcp.json)mcp-config.json into ~/.cursor/mcp.json[mcp_servers.lens] with the same command/args to ~/.codex/config.tomllens 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.
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.
No reviews yet β be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/lens-mcp-2)<a href="https://allmcps.com/mcp/lens-mcp-2"><img src="https://allmcps.com/api/badge/lens-mcp-2?style=directory" alt="Lens MCP on AllMCPs" /></a>