Skip to main content
Glama
jaccoklouwer

AST-Indexer MCP Server

by jaccoklouwer

AST-Indexer MCP Server

AST-Indexer is a Model Context Protocol (MCP) server for indexing Git repositories with AST parsing. It extracts functions, classes, imports, variables, and SQL schema objects from JavaScript, TypeScript, C#, and SQL codebases so they can be queried through MCP tools.

Installation

Install the server globally:

npm install -g @klouwer94/ast-indexer

The published package now includes the required Tree-sitter runtime and grammars as regular runtime dependencies, so AST tools work in normal global and npx installs without extra manual setup on the supported Node.js majors above.

Node.js 25 is not currently supported for the published package because upstream tree-sitter does not ship a compatible native build there. The repository itself may still work in some local pnpm setups because it applies a development patch during install, but that patch is not present in a normal consumer npm install. AST-Indexer currently supports Node.js 20, 22, and 24 for published-package usage.

Add it to your MCP client configuration:

{
  "mcpServers": {
    "ast-indexer": {
      "command": "ast-indexer"
    }
  }
}

For npx usage and HTTP transport configuration, see docs/usage.md.

Related MCP server: codebase-index

Features

  • Index Git repositories with include and exclude glob patterns.

  • Parse JavaScript and TypeScript, including .js, .jsx, .mjs, .cjs, .ts, .tsx, .mts, and .cts.

  • Parse C# using regex-based extraction for definitions (classes, methods, properties, using directives, UTF-16 encoding support).

  • Parse SQL using regex-based extraction (tables, views, stored procedures, functions, triggers, and indexes).

  • Search indexed repositories for functions, classes, imports, SQL tables, SQL views, SQL triggers, and SQL indexes.

  • Inspect JavaScript, TypeScript, TSX, C#, and SQL syntax trees with Tree-sitter tools such as get_ast, get_ast_node_at_position, and structural_search.

  • Find syntactic call sites such as C# FluentAssertions chains like .Should() via structural_search instead of definition-only symbol indexes.

  • Return repository-level statistics for indexed files and extracted symbols.

  • Two-layer cache: per-file memory cache backed by a disk cache keyed on Git commit hash or file mtime.

  • Supports both stdio (default) and HTTP (--transport http) transport modes.

  • Built with TypeScript, Zod, and Vitest.

Using the MCP server

See docs/usage.md for the full tool reference, CLI flags, configuration examples, and glob pattern behavior.

If you want to understand how the codebase is structured, see docs/project-architecture.md.

Contributors

Contributors

Contributions are welcome. See CONTRIBUTING.md for local setup and contribution guidelines.

License

ISC

Related MCP Connectors

  • The Cortex MCP server provides read-only access to real-time engineering context from the Cortex developer portal, allowing AI coding assistants to answer natural language questions about your organization's catalog (microservices, libraries, domains, teams, infrastructure), scorecards (engineering standards and best practices), initiatives (goals and deadlines), and Engineering Intelligence metrics. It includes tools for querying documentation, tracking personal entities, and accessing AI-assisted insights across the entire Cortex ecosystem.

  • A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…

  • Coding agents in multi-service codebases routinely rebuild existing helpers, trust stale type definitions, and modify API contracts without knowing who consumes them. Carrick solves this by indexing your entire TypeScript ecosystem across service and repository boundaries. By integrating deeply with the TypeScript compiler, Carrick traces every route, type, and cross-service call while recording function behaviour so agents search by intent rather than name. Delivered via MCP for AI agents and LSP for IDEs, Carrick ensures models see existing endpoints and utilities before generating new code. The scanner is source-available and runs from your CLI or CI pipeline.

  • An MCP server that gives your AI access to the source code and docs of all public github repos

Related MCP Servers

  • A
    license
    Not graded
    quality
    D
    maintenance
    AST-aware codebase indexing with semantic search, exposed as an MCP server. Enables semantic search and file context retrieval across your codebase using natural language queries.
    7 npm
    1
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    A Model Context Protocol server for local repository indexing and code understanding, enabling semantic search, AST analysis, dependency tracking, and symbol resolution.
    1,196 npm
    ISC
  • A
    license
    Not graded
    quality
    D
    maintenance
    An MCP server that indexes your codebase using tree-sitter AST parsing and gives AI tools instant access to structural intelligence like dependency graphs, call trees, and dead code detection from a local SQLite database.
    MIT