ast-outline-mcp

ast-outline-mcp

Enables AI coding agents to efficiently explore codebases by providing structural outlines, module digests, symbol bodies, and AST-aware grep via MCP.

Category
Visit Server

README

ast-outline-mcp

An MCP (Model Context Protocol) server for ast-outline — a tree-sitter-based CLI that lets AI coding agents pull exactly what they need from a codebase: structural outlines, module digests, symbol bodies, and AST-aware grep.

Why

LLM coding agents explore codebases by reading files directly. A 1200-line file costs 1200 lines of context just to answer "what methods are in here?" — ast-outline provides the file's shape in 60–100 lines, and this MCP server exposes that functionality to any MCP-compatible client.

Prerequisites

uv tool install ast-outline

Installation

Run via npx (no install needed)

npx ast-outline-mcp

Install globally

npm install -g ast-outline-mcp
ast-outline-mcp

MCP Client Configuration

Add to your MCP client config (e.g., Claude Desktop):

{
  "mcpServers": {
    "ast-outline": {
      "command": "npx",
      "args": ["ast-outline-mcp"]
    }
  }
}

Local development

npm install
npm run build
npm start

Tools

outline

Get a structural outline of one or more files or directories. Returns signatures with line ranges (no bodies).

Parameters:

  • paths (string[], required) — File or directory paths to outline
  • json (boolean) — Return machine-readable JSON output
  • imports (boolean) — Include import/use/using statements
  • noPrivate (boolean) — Exclude private members
  • noFields (boolean) — Exclude fields/properties
  • noDocs (boolean) — Exclude documentation comments
  • noAttrs (boolean) — Exclude attributes/decorators

digest

Get a compact one-page module map of a directory. Each file gets a size label and token estimate.

Parameters:

  • paths (string[], required) — Directory paths to digest
  • json (boolean) — Return machine-readable JSON output

show

Extract the full source body of one or more symbols from a file.

Parameters:

  • file (string, required) — File path to extract symbols from
  • symbols (string[], required) — Symbol names to extract
  • json (boolean) — Return machine-readable JSON output
  • signature (boolean) — Return header/signature only, no body

grep

AST-aware structural search across files. Matches grouped by enclosing class/function.

Parameters:

  • pattern (string, required) — Search pattern (literal or regex, auto-detected)
  • paths (string[], required) — File or directory paths to search
  • json (boolean) — Return machine-readable JSON output
  • kind (enum: def|call|ref|import) — Narrow results by classification kind
  • wordMatch (boolean) — Match whole words only
  • caseInsensitive (boolean) — Case-insensitive matching
  • filesOnly (boolean) — List matching files only
  • count (boolean) — Show match counts per file
  • maxCount (number) — Maximum number of matches per file

Prompts

explore_codebase

A prompt that guides an LLM to efficiently explore a codebase using ast-outline tools.

Development

npm install
npm test
npm run build

Supported Languages

ast-outline supports 20+ languages including TypeScript, Python, Go, Rust, C#, Java, Kotlin, Ruby, PHP, and more. See the full list.

License

MIT

Recommended Servers

playwright-mcp

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.

Official
Featured
TypeScript
Magic Component Platform (MCP)

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.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

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.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

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.

Official
Featured
TypeScript
Kagi MCP Server

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.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

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.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured