markgregg

code-tree-mcp

Community markgregg
Updated

code tree database mcp service

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)
  • get_code_tree
    • Inputs:
      • workspacePath (required)
      • pathPrefix (optional, workspace-relative prefix)
      • limit (optional)
  • get_file_symbols
    • Inputs:
      • workspacePath (required)
      • filePath (required, workspace-relative)
  • search_symbols
    • Inputs:
      • workspacePath (required)
      • query (required)
      • language (optional: javascript, typescript, java, python)
      • nodeType (optional: module, class, interface, type, function, method)
      • limit (optional)
  • get_dependencies
    • Inputs:
      • 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.

MCP Server · Populars

MCP Server · New

    firish

    Claude Code for Visual Studio

    Bring Claude Code to Visual Studio 2026: A native diff with accept/reject, a live debugger Claude can drive autonomously, Roslyn code navigation, and Test Explorer integration. The IDE half of Claude Code's integration protocol. Community-built, unofficial.

    Community firish
    uiNerd16

    @aicanvas/mcp

    Open-source React and Tailwind component marketplace. Install via the shadcn CLI or your AI editor over MCP, with reproduction prompts for Claude Code, Lovable, and V0.

    Community uiNerd16
    FootprintAI

    Containarium — Agent Runtime

    Open-source agent runtime — SSH-native isolation, eBPF egress policy, Kubernetes + LXC backends, GPU passthrough, MCP-native CLI

    Community FootprintAI
    openfate-ai

    @openfate/bazi-mcp

    OpenFate Bazi MCP server with deterministic Four Pillars calculation, True Solar Time, branch interactions, and reverse Bazi lookup.

    Community openfate-ai
    mohitagw15856

    🧠 PM Skills — 454 Professional Agent Skills for Claude, ChatGPT, Gemini, Cursor, Codex & Hermes

    In Anthropic's official Claude plugin directory · 400 professional Agent Skills (PRDs, launches, compliance, CVs & more) for Claude, ChatGPT, Gemini, Cursor & Codex. Try free in-browser, or 'npx pm-claude-skills add'.

    Community mohitagw15856