Server data from the Official MCP Registry
Deterministic code maps for AI agents: 7 tree-sitter tools for TS/JS/Py — map, find, function_body
Deterministic code maps for AI agents: 7 tree-sitter tools for TS/JS/Py — map, find, function_body
codelens-mcp is a well-structured code analysis server with strong security controls. It properly validates file paths to prevent traversal attacks, uses read-only operations, and includes comprehensive input validation and error handling. Minor code quality observations around error handling consistency do not materially impact security. Supply chain analysis found 5 known vulnerabilities in dependencies (2 critical, 3 high severity).
3 files analyzed · 9 issues found
Security scores are indicators to help you make informed decisions, not guarantees. Always review permissions before connecting any MCP server.
This plugin requests these system permissions. Most are normal for its category.
Add this to your MCP configuration file:
{
"mcpServers": {
"io-github-segentic-lab-codelens-mcp": {
"args": [
"-y",
"codelens-mcp"
],
"command": "npx"
}
}
}From the project's GitHub README.
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.
7 read-only tools. Every list in every response is capped, and every cap is
reported with an explicit truncated flag — no silent cutoffs.
| Tool | What it does |
|---|---|
map | Per-file structural overview of a whole directory tree in one call. Skips node_modules, dist, venv, hidden dirs, etc. The orientation tool. |
overview | One file's top-level structure: imports, exports, classes (with method names), functions — all with 1-based line/endLine. |
functions | Every addressable function in a file — nested functions, methods, getters/setters, class-field arrows, object-literal properties, default exports — with reconstructed signatures, param types, return type, async/exported flags, and parent scope. (Anonymous callbacks passed as arguments and Python lambdas are not listed — they have no name to navigate to.) |
comments | All comments with line ranges, kind (line/block/doc), and TODO/FIXME/FIX/BUG/HACK/NOTE/XXX marker detection (uppercase-only, no prose false-positives). markersOnly: true returns just the debt list. |
function_body | Verbatim source of one function (with decorators) by bare or dotted name (Widget.render) — the focused read that replaces whole-file Reads. Ambiguous names fail listing the candidates; it never guesses. |
find | "Where is X defined?" — locate function/method/class definitions by name across a directory. Definitions only, not call sites. |
info | Server self-description: version, working directory (the path sandbox root), languages, caps. |
overview, functions, and comments accept a single path or an array of up
to 20 paths per call.
| Extension | Language | Grammar |
|---|---|---|
.ts, .mts, .cts | TypeScript | tree-sitter-typescript |
.tsx | TypeScript + JSX | tree-sitter-tsx (dedicated grammar — JSX parses correctly) |
.js, .jsx, .mjs, .cjs | JavaScript | tree-sitter-javascript |
.py | Python | tree-sitter-python |
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.
hasErrors: true plus parseErrors line ranges, because tree-sitter
error-recovery can drop code near the error.isError on the MCP result and return
{error, path, hint} — the hint says how to fix the call.{requested, succeeded, failed} summary; isError only when every file failed.truncated flags carry the true totals.npm install
npm run build # tsc → dist/
npm test # build + 62 tests (51 unit, 11 stdio e2e)
node dist/index.js # stdio MCP server (launch from the project to analyze)
MCP client config:
{
"mcpServers": {
"codelens": {
"command": "node",
"args": ["/path/to/codelens-mcp/dist/index.js"],
"cwd": "/path/to/project-to-analyze"
}
}
}
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).
AGPL-3.0 — see LICENSE.
Be the first to review this server!
by Modelcontextprotocol · Developer Tools
Read, search, and manipulate Git repositories programmatically
by Modelcontextprotocol · Developer Tools
Web content fetching and conversion for efficient LLM usage
by Toleno · Developer Tools
Toleno Network MCP Server — Manage your Toleno mining account with Claude AI using natural language.