code-tree-mcp
Provides tools to index and query symbols and dependencies in JavaScript codebases.
Provides tools to index and query symbols and dependencies in Python codebases.
Provides tools to index and query symbols and dependencies in TypeScript codebases.
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., "@code-tree-mcpindex my codebase at /home/user/project"
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.
code-tree-mcp
An MCP server in Node.js + TypeScript that indexes source code into a local code-tree database for:
JavaScript / TypeScript
Java
Python
The server stores symbols and dependencies per file and exposes MCP tools to query the indexed tree.
Features
Incremental indexing based on file modification time
Local persisted database in
.code-tree/code-tree.dbSymbol extraction for classes, interfaces, types, functions, and methods (language-dependent)
Dependency extraction for imports/requires/packages
MCP tools for indexing, listing tree data, symbol search, and dependency queries
Related MCP server: @codesift/mcp
Install
npm installBuild
npm run buildRun
npm run startFor development:
npm run devMCP Tools
The server exposes these tools:
index_codebaseInputs:
workspacePath(required, absolute path)forceReindex(optional boolean)
get_code_treeInputs:
workspacePath(required)pathPrefix(optional, workspace-relative prefix)limit(optional)
get_file_symbolsInputs:
workspacePath(required)filePath(required, workspace-relative)
search_symbolsInputs:
workspacePath(required)query(required)language(optional:javascript,typescript,java,python)nodeType(optional:module,class,interface,type,function,method)limit(optional)
get_dependenciesInputs:
workspacePath(required)filePath(optional)dependency(optional)limit(optional)
Example MCP Server Configuration
Use your MCP client configuration format to register:
{
"mcpServers": {
"code-tree": {
"command": "node",
"args": ["/absolute/path/to/code-tree-mcp/dist/index.js"]
}
}
}During active development, you can point to TS entry via tsx:
{
"mcpServers": {
"code-tree": {
"command": "npx",
"args": ["tsx", "/absolute/path/to/code-tree-mcp/src/index.ts"]
}
}
}Notes
This implementation uses robust regex-based parsing for broad compatibility.
For deeper AST-level semantic analysis, the parser layer can be upgraded per language.
Available Tools
7 toolsget_code_treeC
Get indexed files with symbol and dependency counts across one or more workspaces.
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | ||
| offset | No | ||
| pathPrefix | No | Optional relative path prefix filter, such as src/ | |
| ignoreGlobs | No | ||
| workspacePath | No | Single absolute workspace path (use workspacePaths to supply multiple). | |
| workspacePaths | No | Absolute paths to the workspaces to operate on. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations and no description of behavioral traits such as required permissions, what data is returned (e.g., what 'counts' include), or whether it is safe to call frequently. The description omits important context about scope and side effects.
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?
Single sentence of 10 words, no fluff. However, it could be slightly expanded to cover more context without losing conciseness.
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?
With 6 parameters, no output schema, and no annotations, the description is too brief. It lacks information about pagination, output format, and the exact meaning of 'counts'. The tool's complexity is not matched by the description.
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 50% (3 of 6 parameters have descriptions). The tool description adds no explanation for parameters like limit, offset, ignoreGlobs, or the relationship between workspacePath and workspacePaths. It does not compensate for the missing schema descriptions.
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?
Description clearly states verb 'get', resource 'indexed files', and what is included ('symbol and dependency counts'). It distinguishes from siblings by implying a broader overview, but does not explicitly differentiate from tools like get_dependencies or get_file_symbols.
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?
No guidance on when to use this tool versus siblings. Does not specify prerequisites (e.g., workspace must be indexed) or scenarios where this is preferred over more specific tools.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_dependenciesC
Get indexed dependencies across one or more workspaces.
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | ||
| offset | No | ||
| filePath | No | ||
| dependency | No | ||
| ignoreGlobs | No | ||
| workspacePath | No | Single absolute workspace path (use workspacePaths to supply multiple). | |
| workspacePaths | No | Absolute paths to the workspaces to operate on. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description must disclose behavioral traits. It only says 'get', implying a read operation, but does not confirm safety, state whether indexing is required, or describe side effects. This is insufficient for an agent to understand the tool's behavior.
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 a single sentence with no fluff, front-loading the core purpose. While it could benefit from more detail, it is concise and direct.
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 7 parameters with none required, no output schema, and no annotations, the description is too minimal. An agent cannot determine how to construct a valid request or interpret the results, making the tool contextually incomplete.
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?
With only 29% schema description coverage, the description should compensate by explaining key parameters. However, it only hints at workspace-related parameters ('across one or more workspaces') and ignores others like limit, offset, filePath, dependency, and ignoreGlobs. The agent gains little additional meaning.
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 verb 'Get' and the resource 'indexed dependencies across one or more workspaces', establishing the tool's purpose. However, it does not differentiate from sibling tools like get_references or search_symbols, and the meaning of 'dependencies' could be more specific.
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 no guidance on when to use this tool instead of alternatives such as get_references or search_symbols. There is no mention of prerequisites, typical use cases, or exclusions.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_file_symbolsB
Get all indexed symbols for a specific file. Searches across all provided workspaces.
| Name | Required | Description | Default |
|---|---|---|---|
| filePath | Yes | Workspace-relative file path. | |
| ignoreGlobs | No | ||
| workspacePath | No | Single absolute workspace path (use workspacePaths to supply multiple). | |
| workspacePaths | No | Absolute paths to the workspaces to operate on. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations provided, so description carries full burden. Fails to disclose behavioral traits such as read-only nature, index requirement, or error handling. Only states 'indexed symbols' without elaboration.
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?
Two succinct sentences front-load core purpose and scope. No wasted words.
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?
No output schema, so description should hint at return value. It does not, leaving agents uninformed about what symbols look like. Adequately covers input context but not output.
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 75%, so baseline is 3. Description adds minimal value beyond schema; does not explain ignoreGlobs or clarify workspace parameter selection.
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?
Description clearly states action ('Get all indexed symbols'), resource ('specific file'), and scope ('across all provided workspaces'). Distinguishes from sibling tools like get_references and search_symbols.
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?
No explicit when-to-use or when-not-to-use guidance. Does not mention alternatives or context like when to prefer this over search_symbols.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_index_statusB
Get index status summary (file/symbol/dependency counts and last indexed time).
| Name | Required | Description | Default |
|---|---|---|---|
| ignoreGlobs | No | ||
| workspacePath | No | Single absolute workspace path (use workspacePaths to supply multiple). | |
| workspacePaths | No | Absolute paths to the workspaces to operate on. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries full behavioral disclosure burden. It only mentions output contents but omits side effects (none expected), error behavior for invalid paths, auth requirements, or rate limits. The read-only nature is implicit but not stated.
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?
Single sentence, front-loaded, no redundancy. However, it could incorporate more detail without harming conciseness, e.g., mentioning that counts are for the specified workspace.
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?
No output schema exists, so the description should explain return format and possible values. It does not cover error conditions, pagination, or interpretation of counts. For a status tool, this is insufficient.
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 67%, with descriptions for workspacePath and workspacePaths. The tool description adds no parameter information beyond the schema; ignoreGlobs remains undocumented. Baseline 3 applies as schema covers most parameters.
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 retrieves an index status summary including specific counts (files, symbols, dependencies) and last indexed time. This verb+resource structure effectively distinguishes it from sibling tools like get_code_tree or search_symbols.
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 no guidance on when to use this tool versus alternatives like index_codebase or get_dependencies. It lacks context about prerequisites, typical scenarios, or exclusions.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_referencesC
Find files that reference a dependency/module name.
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | ||
| offset | No | ||
| dependency | Yes | ||
| ignoreGlobs | No | ||
| workspacePath | No | Single absolute workspace path (use workspacePaths to supply multiple). | |
| workspacePaths | No | Absolute paths to the workspaces to operate on. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden of behavioral disclosure. It does not state whether the tool is read-only, whether it searches recursively, or any performance implications. The description is too minimal to convey safe usage behavior.
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 a single sentence with no clutter. It is efficient but could benefit from additional context without being verbose.
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 6 parameters, no output schema, and no annotations, the description is inadequate. It fails to explain pagination (limit/offset), filtering (ignoreGlobs), or return format. The description leaves significant gaps for an agent to use 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 only 33% (workspacePath and workspacePaths have descriptions). The tool description adds no extra explanation for parameters like limit, offset, or ignoreGlobs. Users must infer meaning from names alone.
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 verb 'Find' and the resource 'files referencing a dependency/module name', which distinguishes it from siblings like get_dependencies and get_code_tree. However, it could be more specific about the scope (e.g., entire project or specific directory).
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?
No guidance is provided on when to use this tool versus alternatives like get_dependencies or search_symbols. There is no mention of prerequisites, limitations, or exclusions.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
index_codebaseC
Scan and index JavaScript/TypeScript, Java, and Python files. Accepts one or more workspace paths.
| Name | Required | Description | Default |
|---|---|---|---|
| ignoreGlobs | No | Additional ignore glob patterns for this operation. | |
| forceReindex | No | If true, reindex every file even when mtime has not changed. | |
| workspacePath | No | Single absolute workspace path (use workspacePaths to supply multiple). | |
| workspacePaths | No | Absolute paths to the workspaces to operate on. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description must convey behavioral traits. It only mentions scanning and indexing files, but does not disclose whether the operation is destructive (e.g., overwrites existing index), its impact on system state, or any prerequisite conditions (e.g., workspace must be a directory).
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 a single, clear sentence that conveys the core functionality and supported file types. No unnecessary words 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 the tool's complexity (indexing codebases) and lack of output schema or annotations, the description omits important details such as the outcome (e.g., index storage location), performance implications, or how to verify indexing completion. The schema covers parameters well, but overall context is lacking.
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%, so parameters are well-documented. The description adds 'one or more workspace paths' which complements the schema's workspacePath and workspacePaths, but does not provide additional semantics beyond what the schema already explains.
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 it scans and indexes specific file types (JavaScript/TypeScript, Java, Python) and accepts workspace paths. This differentiates it from sibling tools like search_symbols or get_file_symbols, which operate on the indexed data.
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?
No guidance on when to use this tool vs alternatives. The sibling tools serve different purposes (tree, dependencies, symbols, etc.), but the description does not explain that this tool should be called first to build an index before using the others.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
search_symbolsC
Search symbols by name/signature with optional language and node type filters across one or more workspaces.
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | ||
| query | Yes | ||
| offset | No | ||
| language | No | ||
| nodeType | No | ||
| ignoreGlobs | No | ||
| workspacePath | No | Single absolute workspace path (use workspacePaths to supply multiple). | |
| workspacePaths | No | Absolute paths to the workspaces to operate on. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, and the description does not disclose behavioral traits beyond the obvious read operation. It does not mention pagination behavior, rate limits, or what happens with empty results, leaving the agent to infer from parameter names alone.
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?
Single sentence, front-loaded with the operation, minimal word count, zero fluff. Every word is functional.
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 8 parameters, no output schema, and no annotations, the description is too sparse. It lacks details on query syntax, limit/offset behavior, return format, and error conditions, making it insufficient for reliable agent invocation.
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?
With only 25% schema coverage, the description should add parameter context, but it only mentions 'name/signature' for query and 'optional language and node type filters'. It does not explain the format of 'query' (e.g., regex or substring), what 'signature' means, or how 'ignoreGlobs' filters work.
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 searches symbols by name/signature with optional filters across workspaces. It uses a specific verb and resource, but does not explicitly differentiate from siblings like 'get_references' or 'get_file_symbols', which might also relate to symbols.
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?
No guidance on when to use this tool versus alternatives. It mentions optional filters but does not indicate prerequisites, when not to use, or suggest alternatives among sibling tools.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
TDQS
Each tool targets a distinct aspect of codebase analysis: tree structure, dependencies, file symbols, index status, references, indexing, and symbol search. There is no functional overlap.
All tools follow a consistent verb_noun pattern in snake_case (get_*, index_*, search_*), making the set predictable and easy to navigate.
Seven tools is well-scoped for the domain of code indexing and querying. Each tool serves a clear purpose without excess or deficiency.
The set covers all fundamental operations: indexing, status, and various retrievals (tree, dependencies, symbols, references, search). A minor gap is the lack of an explicit tool to delete or reset the index, but this is not critical for typical usage.
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
An MCP server that provides tools to discover and retrieve podcast episodes transcripts.
An MCP server that gives your AI access to the source code and docs of all public github repos
A MCP server built for developers enabling Git based project management with project and personal…
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceAn MCP server that indexes local Python projects into a SQLite database to enable efficient symbol searching and dependency tracking. It allows users to find function or class definitions, trace module imports, and read file contents through natural language interfaces.
- AlicenseNot gradedqualityBmaintenanceMCP server for local-first lexical code search, providing tools for searching code, finding symbols, and reading chunks from indexed repositories.MIT
- AlicenseNot gradedqualityCmaintenanceMCP server for semantic code search and dependency graph analysis. Indexes codebases into a knowledge graph with vector embeddings for AI-powered code understanding.32MIT
- AlicenseNot gradedqualityBmaintenanceMCP server that builds a deterministic, source-traceable knowledge index of any codebase, enabling glossary lookup, code graphs, and exact-token search with every fact linked to its source file and line.141MIT
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/markgregg/code-tree-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server