Ast Impact Mapper MCP server
MCP server that uses TypeScript AST to find which tests are affected by a code change
0 stars
Reviews
Write oneNobody has reviewed Ast Impact Mapper yet.
If you have run it, two minutes of your experience saves the next person an afternoon.
Ast Impact Mapper tools (15, 1 write)
write = sends, deletes, buys or postsRead from the package source without running it. The installed server may list more.
analyze_api_surface_mutationCompares a file against its HEAD version and classifies the change as
detect_architectural_cyclesDetects circular import dependencies — A imports B which imports C which imports A.
differentiate_type_impactClassifies each changed file as type-only or runtime, then splits affected tests into
explain_impactFinds the exact import chain that connects a changed source file to a test file.
generate_skeleton_viewGenerates a token-optimized representation of a source file by stripping function and method bodies, keeping only JSDocs and declarations with line numbers.
generate_test_commandOutputs the optimal test execution command for Jest, Vitest, or Playwright based on changed files.
get_affected_testsGiven a list of changed source files, returns which test files are affected —
get_affected_tests_by_branchwrite actionRuns `git diff --name-only <base_branch>...HEAD` internally and returns affected test files.
get_coverage_gapsFinds source files that are not reachable from any test file through the import graph —
get_dependency_graphReturns the direct import graph for a specific file:
get_rename_aware_diffLike get_affected_tests_by_branch, but correctly handles renamed and moved files.
get_symbol_dependency_graphRetrieves a bidirectional or directed dependency graph mapped to individual declarations, functions, and variables.
get_test_summaryReturns a bird's-eye view of the project's test structure: coverage rate,
identify_unreachable_modulesFinds source files that are never imported by any other file — dead code candidates safe to delete.
refresh_projectClears the cached AST for a project root, forcing a full re-parse on the next call.
Public scan report
scanner v0.1.9 · 2026-09-27 · same rubric, same numbers if you re-run it
- Code scan8 source files scanned13/25
- –Live reliabilityno gateway calls yet and no remote to proben/a
- –Tool poisoningtools not inspected (local package is not executed); not countedn/a
- Auth qualitylocal package, no credentials required12/15
- Maintenancelast push 129 days ago8/15
- Maintainer identityregistry namespace matches repository owner; GitHub account older than a year8/10
Findings (1)
- highShell command built from a string (injection risk)
exec.shell-concatdist/analyzer.js: …fOutput; try { diffOutput = execSync(`git diff --name-only ${baseBranch}...HEAD`, { cwd: …
How Ast Impact Mapper compares
Against every graded MCP server, from our own scans and uptime checks. Updated after each scan run.
- Safety score
- 63/100
- higher than 18% of 48,273 servers
- Tools
- 15
- the typical server has 7
- Tools that change things
- 7%
- typical: 0%. Fewer write tools means less an agent can break
What its tools let an agent do: 12 read · 2 create · 1 change
Install Ast Impact Mapper in Claude Code, Cursor or VS Code
Runs npx -y ast-impact-mapper-mcp on your machine. Read the scan report first; the gateway never runs local packages.
claude mcp add ast-impact-mapper-mcp -- npx -y ast-impact-mapper-mcp
What the publisher says
From the Ast Impact Mapper repository's README, as published. We do not edit it. Read it on GitHub
🗺️ ast-impact-mapper-mcp ✨
"Stop boiling the ocean. Run only the tests that actually care about your changes." 🐸
ast-impact-mapper-mcp is an advanced Model Context Protocol (MCP) server that analyzes your TypeScript/JavaScript codebase using AST parsing (ts-morph) and dependency graph tracing. It helps AI agents (like Claude or Cursor) target only the relevant tests, find dead code, identify circular import dependencies, and trace API mutations.
🧐 Why import graphs?
Guessing affected tests based on matching filenames (e.g. auth.ts -> auth.test.ts) is highly inaccurate. Running the entire test suite on every minor change is extremely slow.
Import graphs do not lie. If a test file transitively imports a modified source file, it must be run. ast-impact-mapper-mcp builds a bidirectional file dependency graph and answers "which tests should I run?" in milliseconds.
💡 Quick Showcase (Real-World e2e Flow)
Imagine your AI agent modifies a shared helper: src/utils/auth.ts. Instead of blindly running all tests or guessing by name, the agent uses this MCP server:
1. Identify Affected Tests
The agent calls getaffectedtests with the changed file:
// Tool Call: get_affected_tests({ changed_files: ["src/utils/auth.ts"] })
{
"changed_files": ["/project/src/utils/auth.ts"],
"affected_tests": ["/project/tests/checkout.spec.ts"],
"total_affected": 1
}2. Explain the Connection
To understand why checkout.spec.ts depends on auth.ts, the agent calls explain_impact:
// Tool Call: explain_impact({ changed_file: "src/utils/auth.ts", test_file: "tests/checkout.spec.ts" })
{
"found": true,
"import_chain": [
"/project/tests/checkout.spec.ts",
"/project/src/fixtures/user-fixture.ts",
"/project/src/utils/auth.ts"
]
}Aha! The checkout spec imports the user-fixture, which imports auth!
3. Check for Runtime Impact
If the change in auth.ts was only adding a TypeScript interface (type-only change), calling differentiatetypeimpact tells the agent:
{
"files": [{ "file": "/project/src/utils/auth.ts", "runtime_impact": false }],
"total_tests_must_run": 0,
"total_tests_skippable": 1
}Success! Since it is a type-only change, the agent can skip running tests entirely, saving precious CPU cycles and time.
4. Run Minimal Tests
If it does contain runtime changes, the agent requests the execution command:
// Tool Call: generate_test_command({ changed_files: ["src/utils/auth.ts"], runner: "vitest" })
{
"command": "npx vitest run tests/checkout.spec.ts"
}🛠️ MCP Tools Reference
All tools are configured with consistent, type-safe schemas (arguments in snake_case).
1. Impact Mapping & Tracing
- #### getaffectedtests
Finds all test files transitively importing changed source files.
- Arguments:
- project_root (string, required): Absolute path to the TypeScript project.
- changed_files (string[], optional): Modified file paths.
- git_diff (string, optional): Raw stdout of git diff --name-only.
- Returns: Detailed map of changed files, affected tests, and totals.
- #### getaffectedtestsbybranch
Shortened. The full README is on GitHub.
Nothing above is checked by us. What we check is on the safety report.
Ast Impact Mapper: common questions
- Is Ast Impact Mapper MCP server safe?
- With care: it is graded C, so read the findings first (63/100). Read the Ast Impact Mapper safety report
- How do I install Ast Impact Mapper?
- It runs on your machine. Copy the Claude Code, Cursor, VS Code or Claude Desktop config from the install section.
- Does Ast Impact Mapper need an API key?
- Not as far as the registry entry and our scan can tell: no credentials are declared or required.
- Is Ast Impact Mapper maintained?
- The last commit was 165 days ago (2026-05-21). The latest release is v0.3.1.
- How does Ast Impact Mapper compare with other MCP servers?
- safety score 63/100 (higher than 18% of 48,273 servers); tools 15 (the typical server has 7); tools that change things 7% (typical: 0%. Fewer write tools means less an agent can break). Full comparison.