code-tree-mcp
An MCP server that indexes source code into a local database and provides tools for querying code symbols, dependencies, and tree structure for JavaScript/TypeScript, Java, and Python.
README
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.db - Symbol 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
Install
npm install
Build
npm run build
Run
npm run start
For development:
npm run dev
MCP Tools
The server exposes these tools:
index_codebase- Inputs:
workspacePath(required, absolute path)forceReindex(optional boolean)
- Inputs:
get_code_tree- Inputs:
workspacePath(required)pathPrefix(optional, workspace-relative prefix)limit(optional)
- Inputs:
get_file_symbols- Inputs:
workspacePath(required)filePath(required, workspace-relative)
- Inputs:
search_symbols- Inputs:
workspacePath(required)query(required)language(optional:javascript,typescript,java,python)nodeType(optional:module,class,interface,type,function,method)limit(optional)
- Inputs:
get_dependencies- Inputs:
workspacePath(required)filePath(optional)dependency(optional)limit(optional)
- Inputs:
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.
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.