codelens-mcp
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@codelens-mcpshow me the overview of src/utils.ts"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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.
Related MCP server: code-analyze-mcp
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.
Tool | What it does |
| Per-file structural overview of a whole directory tree in one call. Skips |
| One file's top-level structure: imports, exports, classes (with method names), functions — all with 1-based |
| 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, |
| All comments with line ranges, kind ( |
| Verbatim source of one function (with decorators) by bare or dotted name ( |
| "Where is X defined?" — locate function/method/class definitions by name across a directory. Definitions only, not call sites. |
| 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.
Languages
Extension | Language | Grammar |
| TypeScript | tree-sitter-typescript |
| TypeScript + JSX | tree-sitter-tsx (dedicated grammar — JSX parses correctly) |
| JavaScript | tree-sitter-javascript |
| Python | tree-sitter-python |
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
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"
}
}
}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.
Available Tools
7 toolscommentsA
All comments in a file with 1-based line ranges, kind (line | block | doc — doc covers /** */ and Python docstrings in real docstring position), and marker detection. Returns JSON {path, language, hasErrors, comments[{line, endLine, text, kind, marker}]}. marker is TODO|FIXME|FIX|BUG|HACK|NOTE|XXX when the comment contains that UPPERCASE word (case-sensitive to avoid prose false-positives), else null. Set markersOnly:true to get only marked comments (the debt list). Comment text clips at 600 chars (textTruncated:true); list caps at 500. Languages: TS/TSX/JS/JSX/Python. Use for surveying docs/debt without reading whole files. 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.
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | File path. Relative paths resolve against the server's working directory; absolute paths are allowed only inside it (anything outside is rejected — call info to see the root). Supported: .ts .tsx .mts .cts .js .jsx .mjs .cjs .py. Accepts a single path or an array of up to 20 paths; an array returns {results, summary} with per-file entries. | |
| markersOnly | No | Return only comments carrying a TODO/FIXME/FIX/BUG/HACK/NOTE/XXX marker (default false). |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden. It discloses the JSON return shape, truncation at 600 chars, list cap at 500, marker case-sensitivity to avoid false positives, and supported languages. It also warns against relying on signatures alone, adding valuable behavioral context.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is detailed but every sentence earns its place: it leads with a one-sentence summary, explains output format, limitations, languages, and use cases. The final caution about reading source code is relevant. It is front-loaded and information-dense without being padded.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The tool supports array input, returns per-file results with a summary, and has no output schema, so the description must explain return values. It does so thoroughly, covering structure, edge cases (truncation, caps), and usage context. Given the complexity, it is complete enough for an agent to select and invoke correctly.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100% for parameters, so the baseline is 3. The description adds minimal parameter-specific meaning beyond the schema; it mentions 'markersOnly:true' but repeats the schema's semantics. The description's extra context about output and behavior does not significantly enhance parameter understanding.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states what the tool does: it returns all comments in a file with line ranges, kind, and marker detection. It distinguishes itself from siblings like codelens by positioning itself for surveying docs/debt rather than locating code. The specific output format and options further clarify its purpose.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Explicit guidance is provided: 'Use for surveying docs/debt without reading whole files.' It contrasts with codelens, which is for locating code, and advises reading the actual source before modifying. This gives clear when-to-use context and differentiates from alternatives.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
findA
Locate a function, method, or class by name across a directory — "where is X defined?" without grepping. Returns JSON {query, path, matches[{file, name, kind, line, signature, parent}], filesScanned, totalSupportedFiles, truncated, skipped?}. kind is function|method|arrow|getter|setter|class. Matching is case-insensitive substring by default; pass exact:true for exact-name match. Files that could not be searched (oversized/unreadable) are listed in skipped with the reason — never silently ignored. Caps: scans up to 300 files, returns up to 100 matches — truncated:true means there may be more (narrow the path or use exact:true). Finds DEFINITIONS only (not call sites — use grep for those). Languages: TS/TSX/JS/JSX/Python. 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.
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Symbol name to find (function/method/class). Substring match unless exact:true. | |
| path | No | Directory (or single file) to search, relative to the server working directory. Default: "." (whole workspace). | |
| exact | No | Exact, case-sensitive name match instead of case-insensitive substring (default false). |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are present, so the description carries full burden. It thoroughly discloses the return JSON shape, match kinds, case-insensitive substring default, exact matching option, skipped file handling with reasons, scan/match caps, truncation flag, and supported languages. This is exemplary transparency.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is long but extremely dense, with every sentence earning its place. It is front-loaded with the core purpose, then systematically covers output, matching behavior, skipped files, limits, languages, and follow-up guidance. No filler or repetition.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given no output schema and no annotations, this description remarkably covers all necessary context: the exact return object, handling of unsearchable files, caps and truncation, languages, positional nuance (definitions vs call sites), and even a caution to read actual source. It is fully self-sufficient for an agent to select and invoke the tool correctly.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so baseline is 3. The schema already explains 'Substring match unless exact:true' and exact as 'case-insensitive substring'. The description adds little beyond restating these rules and the default path, so it does not significantly increase semantic understanding beyond the structured schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description uses a specific verb ('Locate') and resource ('function, method, or class by name across a directory'), immediately clarifying 'where is X defined?'. It also distinguishes itself by stating 'Finds DEFINITIONS only (not call sites — use grep for those)', which separates it from sibling tools like grep or possibly functions.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
It explicitly states when to use ('where is X defined?') and when not ('not call sites — use grep for those'), giving an alternative. It also provides operational guidance like narrowing the path or using exact:true, and advises reading the actual source after locating — clearly covering when-to-use vs. alternatives.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
function_bodyA
Verbatim source of ONE function — the focused read. Instead of Reading a whole file to inspect one function, get exactly that function's source (including its signature and decorators). Returns JSON {path, name, parent, kind, signature, line, endLine, async, exported, hasErrors, body}. name matches the bare name or the dotted qualified form from functions/find output (e.g. 'Widget.render'); if the name is ambiguous, the call FAILS listing the candidates with their lines — pass the qualified name or line to pick one, it never guesses. body is real source, capped at 20000 chars (truncated.bodyChars = true length — Read line..endLine for the rest). The body IS the territory for this one function, so you may reason about its internals — but not about its callers/callees, and re-Read before editing (files change). Languages: TS/TSX/JS/JSX/Python.
| Name | Required | Description | Default |
|---|---|---|---|
| line | No | Disambiguator: the line number of the wanted definition (from functions/find output), when the same name has several definitions. | |
| name | Yes | Function/method name. Bare ('render') or dotted-qualified ('Widget.render') as reported by functions/find. Default exports are named 'default'. | |
| path | Yes | File path. Relative paths resolve against the server's working directory; absolute paths are allowed only inside it (anything outside is rejected — call info to see the root). Supported: .ts .tsx .mts .cts .js .jsx .mjs .cjs .py |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description fully carries behavioral disclosure. It reveals failure behavior on ambiguous names ('the call FAILS listing the candidates'), truncation at 20000 chars with a truncated flag, that it 'never guesses', and the ephemeral nature of files ('re-Read before editing'). This is exemplary transparency.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is front-loaded with the core function, then progressively adds return format, naming, failure, truncation, and usage guidance. Despite its length, every sentence provides actionable detail with no redundancy, making it highly efficient.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a tool with no output schema, the description compensates by enumerating the JSON fields, supported languages, size caps, and error behavior. It covers all necessary context for an agent to invoke the tool safely and correctly, leaving no critical gaps.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema covers all parameters with descriptions, so baseline is 3. The description adds value by explaining that name matches functions/find output (dotted-qualified form, default exports named 'default') and that line is a disambiguator when names collide, exceeding the schema's basic definitions.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description opens with 'Verbatim source of ONE function — the focused read' and clarifies it returns exactly that function's source including signature and decorators. It explicitly contrasts with reading a whole file, and the return JSON structure confirms the tool's specific scope.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
It states when to use this tool ('Instead of Reading a whole file to inspect one function') and defines boundaries ('The body IS the territory for this one function... but not about its callers/callees'). It supports disambiguation via functions/find output, but doesn't name a specific alternative for exploring callers/callees, so it just misses a fifth.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
functionsA
Every addressable function in a file — nested functions, class methods, getters/setters, class-field arrows, namespace members, object-literal methods/properties, default-export functions — with reconstructed signatures. NOT listed: anonymous callbacks passed as arguments (they have no name to navigate to), TS overload signature declarations (only implementations), Python lambdas. Returns JSON {path, language, hasErrors, functions[{name, signature, params[{name,type}], returnType, line, endLine, async, exported, kind, parent}]}. kind is function|method|arrow|getter|setter; parent is the enclosing scope, dotted for nesting (e.g. 'Widget.render'), null at top level; default exports are named 'default'. hasErrors:true = syntax errors, items may be missing. Caps at 500 entries (truncated.functions = true total). Languages: TS/TSX/JS/JSX/Python. Use it to pick the right line range to Read, or to survey an API surface. 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.
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | File path. Relative paths resolve against the server's working directory; absolute paths are allowed only inside it (anything outside is rejected — call info to see the root). Supported: .ts .tsx .mts .cts .js .jsx .mjs .cjs .py. Accepts a single path or an array of up to 20 paths; an array returns {results, summary} with per-file entries. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries full burden and does so thoroughly. It discloses exclusions (anonymous callbacks, overload declarations, lambdas), error behavior (hasErrors, items may be missing), the 500-entry cap with truncated.functions flag, supported languages, and how parent/kind/default exports are represented. It even warns 'A signature is not the body' — rich behavioral context beyond what schema or annotations could provide.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Despite being lengthy, every sentence adds distinct value: purpose, exclusions, return shape, field semantics, edge cases, cap, languages, and usage guidance. It is front-loaded with core functionality, then uses structured labels ('NOT listed', 'Returns', 'kind', 'parent', 'hasErrors', 'Caps') to make scanning easy. No filler or repetition.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a complex tool with no output schema, the description is remarkably complete. It covers the full return JSON structure, enumerates all field meanings (kind, parent, async, exported), explains error states, caps, language support, and how to use the result. It also contextualizes the relationship with other navigation tools and advises on proper follow-up (Read the actual source). Nothing important is missing.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100% and the path parameter is already fully described in the schema (path type, relative/absolute resolution, array behavior, supported extensions). The main description adds no additional parameter-level details. Per the rubric, this is a baseline 3: the schema does the heavy lifting and the description doesn't need to compensate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description opens with a specific verb+resource: 'Every addressable function in a file' and immediately enumerates exactly what is included (nested functions, class methods, getters/setters, etc.) and what is NOT listed (anonymous callbacks, TS overload signatures, Python lambdas). This clearly distinguishes it from sibling tools like map or function_body, which likely serve different navigation purposes.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Explicit usage guidance is given: 'Use it to pick the right line range to Read, or to survey an API surface.' It also contrasts with another tool ('codelens is a navigation map: use it to LOCATE code, then Read the actual source before judging or modifying it'), providing an alternative and even a warning about not relying on signatures alone.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
infoA
Server self-description: version, working directory (the path sandbox root — every path you pass must be inside it), supported languages/extensions, tool list, and all output caps. Returns JSON {name, version, workingDirectory, languages, tools[], limits, contract}. Read-only, no parameters. Call this first if a path is rejected or you need to know what the server can see.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure. It explicitly states the tool is read-only, has no parameters, returns a JSON object with a specific structure, and includes the critical constraint that the working directory is the sandbox root and all passed paths must be inside it. It does not describe error behavior or rate limits, but for a simple self-description tool, this is quite transparent.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is concise and front-loaded with the core purpose. It packs three sentences of high-value content: what the tool returns, the JSON structure, and when to call it. There is no filler or redundant information.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a tool with no params and no output schema, the description is exceptionally complete. It explains the return format, the critical sandbox-root constraint, and provides a use case. The tool is simple, and the description covers all relevant context without requiring the agent to infer anything.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The tool has zero parameters, and the schema confirms this with an empty properties object. The description reinforces 'no parameters' and does not need to explain parameter meaning. Baseline for zero-parameter tools is 4, and the description adds value by stating the returned JSON structure, which is more than the schema provides.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description opens with 'Server self-description', which is a specific verb+resource phrase that clearly identifies the tool's purpose. It enumerates exactly what information is returned (version, working directory, languages, tools, limits, contract) and distinguishes it from sibling tools like 'functions' or 'map' by focusing on server metadata rather than code navigation.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides explicit, actionable usage guidance: 'Call this first if a path is rejected or you need to know what the server can see.' This tells the agent when to invoke the tool and what problem it solves, which is more directive than most descriptions.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
mapA
Per-file structural overview of a whole directory tree in one call — the orientation tool for an unfamiliar codebase. Walks the directory recursively (skipping node_modules, dist, build, venv, pycache, hidden dirs and other build/dependency dirs), parses every supported file, and returns JSON {path, files[{path, language, totalLines, classes[], functions[], hasErrors?, error?}], totalSupportedFiles, filesParsed, truncated}. Caps: 200 files per call (truncated:true when more exist — map subdirectories individually to go deeper), 100 names per list per file. Unparseable files appear with an inline error instead of vanishing. Languages: TS/TSX/JS/JSX/Python; other files are not counted. Use before overview/functions to decide which files matter. 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.
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Directory to map, relative to the server's working directory (or absolute inside it). Use "." for the whole workspace. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden and excels: it discloses skipped directories, per-call file caps (200) and per-file name caps (100), truncated behavior, handling of unparseable files with inline errors, supported languages, and the exact return JSON structure. This is exemplary transparency beyond what any structured metadata could provide.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Though long, every sentence earns its place. It is front-loaded with purpose, then behavior, limits, language support, and usage guidance. No filler or redundancy; dense but well-structured.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Despite having no output schema, the description fully outlines the return JSON shape, fields, and error handling. It also contextualizes the tool among siblings (map before overview/functions, then Read) and provides practical caps. This is complete for a directory-walking tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100% — the 'path' parameter is already thoroughly described in the schema (relative path, absolute path, '.' for workspace). The description adds no new parameter-specific semantics beyond what the schema provides, so the baseline 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states what the tool does: 'Per-file structural overview of a whole directory tree in one call' — a specific verb-as-noun 'map' applied to a resource (directory tree). It also distinguishes itself from siblings by positioning as 'the orientation tool' and advising use before overview/functions.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
It explicitly says when to use it ('Use before overview/functions to decide which files matter') and provides an alternative strategy when truncated ('map subdirectories individually to go deeper'). It also instructs to Read the actual source after locating code. However, it does not explicitly state when not to use the tool versus alternatives, so it falls short of a 5.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
overviewA
Structural map of source files: imports, exports, classes (with method names, including class-field arrow methods), and top-level functions — each with 1-based line/endLine so you can jump straight to a Read. Returns JSON {path, language, totalLines, hasErrors, imports[], exports[], classes[{name,line,endLine,methods[]}], functions[{name,line,endLine,exported}]}. hasErrors:true means the file has syntax errors and items may be missing (parseErrors lists the offending line ranges). Nested functions are NOT listed here (use the functions tool). Lists cap at 500 entries; when capped, truncated. holds the true total. Languages: TypeScript (.ts/.tsx/.mts/.cts), JavaScript (.js/.jsx/.mjs/.cjs), Python (.py). Python exports come from all. Use this FIRST to orient in an unfamiliar file. 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.
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | File path. Relative paths resolve against the server's working directory; absolute paths are allowed only inside it (anything outside is rejected — call info to see the root). Supported: .ts .tsx .mts .cts .js .jsx .mjs .cjs .py. Accepts a single path or an array of up to 20 paths; an array returns {results, summary} with per-file entries. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden and delivers richly: it discloses the return JSON schema, the meaning of `hasErrors`, list truncation at 500 with a `truncated` field, language support, and the fact that Python exports come from `__all__`. The caution 'A signature is not the body' adds a relevant behavioral expectation. This is a model of transparency.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is long but densely packed with useful details; the main purpose is front-loaded and subsequent sentences add return-format details, language support, usage guidance, and clarity about truncation and nested functions. No sentence is wasted, though the 'codelens is a navigation map' line slightly rephrases the opening purpose.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The description is comprehensive for a one-parameter read-only exploration tool. It specifies the return shape precisely, covers edge cases like syntax errors and truncation, lists supported languages, and provides usage context. Even without an output schema, the agent would know exactly what to expect.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100% for the single `path` parameter, which already explains path resolution, supported extensions, and array handling. The description doesn't add further parameter-level meanings, so the baseline 3 applies.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's function with a specific verb+resource: it provides a structural map of source files listing imports, exports, classes, and top-level functions. It differentiates from the sibling `functions` tool by explicitly noting nested functions are excluded and directing users to that tool. This gives both a clear purpose and a contrast with alternatives.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Explicit guidance is provided: 'Use this FIRST to orient in an unfamiliar file' and 'use it to LOCATE code, then Read the actual source before judging or modifying it.' The description also points to the `functions` tool for nested functions, establishing when not to use this tool. This exceeds typical usage guidance.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
7 tool updates
v0.2.0- First observed
comments - First observed
find - First observed
function_body - First observed
functions - First observed
info - First observed
map - First observed
overview
TDQS
overview and functions both list functions/classes, but overview provides a high-level structural map while functions exhaustively lists all addressable functions; the descriptions clearly differentiate them. map covers directory trees, find locates definitions by name, and function_body returns verbatim source, so each tool has a distinct role with minor potential confusion.
Most tool names are simple lowercase nouns (overview, functions, comments, map, info), but 'find' is a verb and 'function_body' uses an underscore, breaking a uniform pattern. The naming is still predictable and readable, though not consistently verb_noun or single-style.
Seven tools is well-scoped for a code navigation and analysis server. Each tool serves a distinct purpose, and none feel redundant or unnecessary.
The toolset covers the core navigation lifecycle: directory maps, file overviews, function details, comment exploration, definition lookup, and focused source extraction. Missing are call sites or full-text search, but the stated purpose of locating code is well covered.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Give your AI agent a persistent map of your project's structure, dependencies, and bugs.
Shared memory for coding agents. Stop re-explaining your codebase every session.
Code intelligence for coding agents: semantic, AST, graph, and full-text search. 279+ languages.
Code intelligence platform for AI agents. 20 tools for architecture, security & impact analysis.
Related MCP Servers
- AlicenseAqualityDmaintenanceProvides code context and analysis for AI assistants by extracting directory structures and code symbols using WebAssembly Tree-sitter parsers with zero native dependencies.12520MIT
- AlicenseNot gradedqualityAmaintenanceStandalone MCP server for code structure analysis using tree-sitter. Directory trees, symbol definitions, and call graphs without reading raw source files. Supports Rust, Python, Go, Java, TypeScript, Fortran, JavaScript, C/C++, and C#. Benchmarked up to 68% fewer tokens vs native tools.5Apache 2.0

loctree-mcpofficial
FlicenseNot gradedqualityAmaintenanceStructural code intelligence for AI agents. Scan once, query everything — dead exports, circular imports, dependency graphs, and more. CLI + MCP server.69-- AlicenseNot gradedqualityAmaintenanceA local MCP server that gives AI coding agents symbol definitions, dependency graphs, and a live architecture vocabulary for TypeScript/JavaScript repos, with no network or embeddings.18MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/segentic-lab/codelens-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server