AstLLM MCP Server

Local setup required. This server has to be cloned and prepared on your machine before you register it in Claude Code.
1

Set the server up locally

Run this once to clone and prepare the server before adding it to Claude Code.

Run in terminal
git clone https://github.com/tluyben/astllm-mcp
cd astllm-mcp
CXXFLAGS="-std=c++20" npm install --legacy-peer-deps
npm run build
2

Register it in Claude Code

After the local setup is done, run this command to point Claude Code at the built server.

Run in terminal
claude mcp add astllm-mcp -- node "<FULL_PATH_TO_ASTLLM_MCP>/dist/index.js"

Replace <FULL_PATH_TO_ASTLLM_MCP>/dist/index.js with the actual folder you prepared in step 1.

README.md

Efficient code indexing and symbol retrieval using tree-sitter AST parsing.

astllm-mcp

MCP server for efficient code indexing and symbol retrieval. Index GitHub repos or local folders once with tree-sitter AST parsing, then let AI agents retrieve only the specific symbols they need — instead of loading entire files.

Simple 1 file binary distribution for trivial deployments.

Cut code-reading token costs by up to 99%.

How it works

  1. Index — fetch source files, parse ASTs with tree-sitter, store symbols with byte offsets
  2. Explore — browse file trees and outlines without touching file content
  3. Retrieve — fetch only the exact function/class/method you need via O(1) byte-offset seek
  4. Savings — every response reports tokens saved vs loading raw files

The index is stored locally in ~/.code-index/ (configurable). Incremental re-indexing only re-parses changed files.

The server automatically indexes the working directory on startup (incremental, non-blocking). Optionally set ASTLLM_WATCH=1 to also watch for file changes and re-index automatically. The watcher skips noisy directories (node_modules, .git, dist, .next, etc.) by default — see Watch excludes below.

Supported languages

Python, JavaScript, TypeScript, TSX, Go, Rust, Java, PHP, Dart, C#, C, C++, Dart/Flutter, Swift

Installation

Option 1: Download a pre-built binary (recommended)

Download the binary for your platform from the GitHub Releases page:

Platform File
macOS ARM (M1/M2/M3) astllm-mcp-macosx-arm
Linux x86-64 astllm-mcp-linux-x86
Linux ARM64 astllm-mcp-linux-arm
# Example for Linux x86-64
curl -L https://github.com/tluyben/astllm-mcp/releases/latest/download/astllm-mcp-linux-x86 -o astllm-mcp
chmod +x astllm-mcp
./astllm-mcp   # runs as an MCP stdio server

No Node.js, no npm, no build tools required.

Option 2: Build from source

Requires Node.js 18+ and a C++20-capable compiler (for tree-sitter native bindings).

git clone https://github.com/tluyben/astllm-mcp
cd astllm-mcp
CXXFLAGS="-std=c++20" npm install --legacy-peer-deps
npm run build

Note on Node.js v22+: The CXXFLAGS="-std=c++20" flag is required because Node.js v22+ v8 headers mandate C++20. The --legacy-peer-deps flag is needed because tree-sitter grammar packages target slightly different tree-sitter core versions.

MCP client configuration

Claude Code

Option A — claude mcp add CLI (easiest):

# Pre-built binary, project-scoped (.mcp.json)
claude mcp add astllm /path/to/astllm-mcp-linux-x86 --scope project

# Pre-built binary, user-scoped (~/.claude.json)
claude mcp add astllm /path/to/astllm-mcp-linux-x86 --scope user

# From source (Node.js), project-scoped
claude mcp add astllm node --args /path/to/astllm-mcp/dist/index.js --scope project

Option B — manual JSON config:

Add to ~/.claude.json (global) or .mcp.json in your project root (project-scoped):

Pre-built binary:

{
  "mcpServers": {
    "astllm": {
      "command": "/path/to/astllm-mcp-linux-x86",
      "type": "stdio"
    }
  }
}

From source (Node.js):

{
  "mcpServers": {
    "astllm": {
      "command": "node",
      "args": ["/path/to/astllm-mcp/dist/index.js"],
      "type": "stdio"
    }
  }
}

Claude Desktop

Add to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):

Pre-built binary:

{
  "mcpServers": {
    "astllm": {
      "command": "/path/to/astllm-mcp-macosx-arm"
    }
  }
}

From source (Node.js):

{
  "mcpServers": {
    "astllm": {
      "command": "node",
      "args": ["/path/to/astllm-mcp/dist/index.js"]
    }
  }
}

Tools

Indexing

`index_repo`

Index a GitHub repository. Fetches source files via the GitHub API, parses ASTs, stores symbols locally.

repo_url            GitHub URL or "owner/repo" slug
generate_summaries  Generate one-line AI summaries (requires API key, default: false)
incremental         Only re-index changed files (default: true)
storage_path        Custom storage directory
`index_folder`

Index a local folder recursively.

folder_path             Path to index
generate_summaries      AI summaries (default: false)
extra_ignore_patterns   Additional gitignore-style patterns
follow_symlinks         Follow symlinks (default: false)
incremental             Only re-index changed files (default: true)
storage_path            Custom storage directory

Navigation

`list_repos`

List all indexed repositories with file count, symbol count, and last-indexed time.

`get_repo_outline`

High-level overview: directory breakdown, language distribution, symbol kind counts.

repo    Repository identifier ("owner/repo" or short name if unique)
`get_file_tree`

File and directory structure with per-file language and symbol count. M

Tools (5)

index_repoIndex a GitHub repository by fetching source files, parsing ASTs, and storing symbols locally.
index_folderIndex a local folder recursively.
list_reposList all indexed repositories with file count, symbol count, and last-indexed time.
get_repo_outlineGet a high-level overview of a repository including directory breakdown and symbol kind counts.
get_file_treeGet file and directory structure with per-file language and symbol count.

Environment Variables

ASTLLM_WATCHSet to 1 to watch for file changes and re-index automatically.

Configuration

claude_desktop_config.json
{"mcpServers": {"astllm": {"command": "/path/to/astllm-mcp-macosx-arm"}}}

Try it

Index the local folder at /projects/my-app to start tracking symbols.
List all currently indexed repositories and their symbol counts.
Get the repository outline for the indexed project to understand its structure.
Fetch the specific function definition for 'calculateTotal' from the indexed codebase.

Frequently Asked Questions

What are the key features of AstLLM MCP?

Uses tree-sitter AST parsing for precise symbol retrieval. Provides O(1) byte-offset access to code components. Supports incremental re-indexing for changed files. Reduces AI token costs by avoiding full file loading. Supports multiple languages including Python, JS, TS, Go, Rust, and more.

What can I use AstLLM MCP for?

Reducing token usage when asking AI to analyze large codebases. Quickly navigating complex project structures without reading entire files. Maintaining an up-to-date index of local development projects for AI agents. Retrieving specific class or function definitions across large repositories.

How do I install AstLLM MCP?

Install AstLLM MCP by running: curl -L https://github.com/tluyben/astllm-mcp/releases/latest/download/astllm-mcp-linux-x86 -o astllm-mcp && chmod +x astllm-mcp

What MCP clients work with AstLLM MCP?

AstLLM MCP works with any MCP-compatible client including Claude Desktop, Claude Code, Cursor, and other editors with MCP support.

Turn this server into reusable context

Keep AstLLM MCP docs, env vars, and workflow notes in Conare so your agent carries them across sessions.

Need the old visual installer? Open Conare IDE.
Open Conare