Ast MCP Server logo

Ast MCP Server

TypeScript-aware MCP tools for bounded code reading, compiler-backed analysis, and reviewed JavaScript or TypeScript edits.

Install Ast MCP Server

Pick your client, then add it in one click or paste the config.

STDIONode.js
~/Library/Application Support/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "ast-mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "ast-mcp-server"
      ]
    }
  }
}

Settings → Developer → Edit Config, merge this into mcpServers, then fully quit and reopen Claude Desktop.

Automated check passed— started and listed 15 tools correctly ().

Overview

ast-mcp-server connects coding agents to TypeScript and JavaScript projects through ts-morph and the TypeScript compiler. It provides bounded file and symbol reads, compiler-resolved references, diagnostics, impact analysis, and affected-test candidates. Mutations use a prepare, review, and apply workflow with hashes, freshness checks, diagnostic guards, and idempotent receipts. Reach for it when an agent needs structural code understanding or controlled project-wide edits instead of text-search guesses.

Use cases

  • Inspect declaration signatures without loading implementation bodies
  • Trace compiler-resolved references and bounded symbol impact
  • Select potentially affected tests from compiler relationships
  • Prepare and review a project-wide symbol rename
  • Replace one method body while preserving its declaration

Key features

  • Bounded TypeScript and JavaScript source inspection
  • Compiler-backed symbol, reference, and impact analysis
  • Paginated files, symbols, and test candidates
  • Project- and file-scoped TypeScript diagnostics
  • Hash-bound prepare, review, and apply edits
  • Freshness, provenance, completeness, and truncation metadata

Tools15

What Ast MCP Server lets your agent do. Expand a tool for its parameters.

Verified live~4.4k tokens of context

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked

Recent health check succeeded.

7/7 checks healthy over the last 25d

What it can do

From the 15 tools this server returned when we ran it; 15 declare their own safety hints.

Handles credentials · 1Read-only tools · 15
Network at startup3 connections
Files written at startupNone
Install scriptsNone
npm provenanceSigned build
Package age94 days
Maintainers1

Observed 2026-11-06 in an isolated sandbox. A description of reach, not a security audit.

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 8d ago via OSV.dev · ast-mcp-server (npm)

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars7Stargazers on the source repository.
npm downloads5.6kPackage downloads in the last 30 days.
Last commit1d agoMost recent push to the default branch.
Availability100%Our rolling endpoint + install checks that succeeded.
Install checkPassedOur sandbox started it and listed its tools.
Tools exposed15Callable tools this server registers over MCP.

How Ast MCP Server works

What ast-mcp-server does

ast-mcp-server gives coding agents structured access to TypeScript and JavaScript projects. Its read operations return focused evidence rather than requiring an agent to load entire files: exact line ranges, declaration outlines without bodies, source for one symbol, references, diagnostics, and bounded impact relationships.

The server uses the TypeScript compiler project model through ts-morph. That lets it distinguish declarations and references by program structure instead of treating matching names as equivalent text. It also exposes project status, paginated source-file discovery, symbol search, and conservative test-candidate selection.

Write operations are deliberately staged. Symbol renames, method-body replacements, and new class scaffolds produce plans first. A caller can inspect the retained diff and apply one reviewed, hash-bound operation only after the relevant checks pass.

How it works

Read requests are bounded and structured. ast_get_file can return selected zero-based source ranges with one-based line records, a SHA-256 byte hash, snapshot state, and project freshness metadata. Symbol-focused requests can return selectors and signatures without implementation bodies. ast_explore combines bounded discovery with optional source and compiler-reference detail, while ast_get_impact reports bounded direct or transitive relationships.

Compiler-backed evidence carries provenance and resolution information. Fresh compiler relationships can support impact evidence and test-candidate selection; syntax-only and heuristic results are intended for navigation or discovery, not mutation authority. The server exposes completeness, truncation, unresolved results, and freshness information rather than presenting every result as equally certain.

For changes, the server compares proposed results with baseline diagnostics and retains an immutable plan. Applying a plan requires the caller to explicitly invoke the apply operation. Hash binding, workspace freshness checks, diagnostic guards, and idempotent receipts help prevent a reviewed change from being applied to a different project state.

Tools and capabilities

  • ast_list_files inventories project-relative source files with pagination.
  • ast_get_project_status reports compiler, freshness, index, and operation state.
  • ast_get_outline, ast_get_symbol_source, and ast_search_symbols support compact structural inspection.
  • ast_find_references, ast_get_impact, and ast_find_test_candidates provide compiler-backed relationship evidence when coverage is complete and fresh.
  • ast_get_diagnostics returns project- or file-scoped TypeScript diagnostics.
  • ast_rename_symbol, ast_replace_symbol_body, and ast_scaffold_class prepare controlled edits.
  • ast_get_operation_preview returns a prepared plan's retained diff, and ast_apply_operation applies one reviewed plan.

Limitations and notes

The server does not treat all evidence as compiler authority. Heuristic results are discovery hints, syntax provenance supports structural navigation, and index data accelerates queries but still requires compiler validation or fallback. Freshness is separate from diagnostic status: a fresh snapshot can still contain TypeScript errors, so diagnostics must be checked independently.

Impact queries refuse non-fresh compiler relationships. Test-candidate discovery admits only complete incoming evidence for relationships such as references, imports, exports, inheritance, implementation, and calls; it selects candidates but never runs tests. Reads and edits are bounded, so truncation, incomplete coverage, and unresolved relationships should be handled by the caller before relying on a result.

Written by AllMCPs with AI assistance from the project’s README and listing data. How we build listings

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about Ast MCP Server

ast-mcp-server is an MCP server that connects coding agents to TypeScript and JavaScript project models through ts-morph and the TypeScript compiler. Its main tools provide bounded file and symbol reads, compiler-resolved references and diagnostics, impact and test-candidate analysis, plus reviewed rename and source-edit operations.

ast-mcp-server uses the TypeScript compiler project model through ts-morph to resolve declarations and references. `ast_find_references` returns compiler-resolved locations, while `ast_get_impact` reports bounded direct or transitive relationships with freshness and completeness metadata.

Prepare the change with an operation such as `ast_rename_symbol`, `ast_replace_symbol_body`, or `ast_scaffold_class`, inspect its retained diff with `ast_get_operation_preview`, then explicitly call `ast_apply_operation`. Plans are hash-bound and checked against workspace freshness and diagnostics.

Yes. `ast_find_test_candidates` returns paginated affected-test candidates based on complete incoming compiler relationships, including references, imports, exports, inheritance, implementation, and calls. It selects candidates conservatively and does not execute tests.

ast-mcp-server requires Node.js 22.13 or newer. The project is distributed as the `ast-mcp-server` npm package and is licensed under ISC.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewAst MCP Server AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/ast-mcp-server?style=directory)](https://allmcps.com/mcp/ast-mcp-server)
HTML Embed
<a href="https://allmcps.com/mcp/ast-mcp-server"><img src="https://allmcps.com/api/badge/ast-mcp-server?style=directory" alt="Ast MCP Server on AllMCPs" /></a>