Server data from the Official MCP Registry
MCP server that uses TypeScript AST to find which tests are affected by a code change
MCP server that uses TypeScript AST to find which tests are affected by a code change
Valid MCP server (2 strong, 3 medium validity signals). No known CVEs in dependencies. Package registry verified. Imported from the Official MCP Registry. Trust signals: trusted author (14/14 approved).
6 files analyzed Β· 1 issue found
Security scores are indicators to help you make informed decisions, not guarantees. Always review permissions before connecting any MCP server.
This plugin requests these system permissions. Most are normal for its category.
Add this to your MCP configuration file:
{
"mcpServers": {
"io-github-vola-trebla-ast-impact-mapper-mcp": {
"args": [
"-y",
"ast-impact-mapper-mcp"
],
"command": "npx"
}
}
}From the project's GitHub README.
An MCP server that uses the TypeScript AST to determine exactly which tests are affected by a code change β so your AI agent stops running the entire suite and starts running only what matters.
When you change src/utils/auth.ts, which tests should run? Most tools either run everything (slow) or guess by filename (wrong). Import graphs don't lie β if a test transitively imports the changed file, it needs to run.
This server builds a precise dependency graph from your TypeScript project and answers that question in milliseconds.
| Tool | Arguments | What it returns |
|---|---|---|
get_affected_tests | project_root, changed_files[] or git_diff | Test files that transitively import any of the changed files |
get_affected_tests_by_branch | project_root, base_branch? | Same as above but runs git diff internally |
get_rename_aware_diff | project_root, base_branch?, similarity_threshold? | Like above but handles file moves/renames and skips whitespace-only changes |
differentiate_type_impact | project_root, changed_files[] | Splits affected tests into must-run vs skippable (type-only changes emit no JS) |
analyze_api_surface_mutation | project_root, file_path | Compares exported signatures against HEAD β breaking_api_change or internal_refactor |
explain_impact | project_root, changed_file, test_file | Step-by-step import chain from a test file to the changed source file |
| Tool | Arguments | What it returns |
|---|---|---|
identify_unreachable_modules | project_root, entry_points[]?, limit? | Source files with zero incoming imports β dead code candidates |
detect_architectural_cycles | project_root | Circular import chains β [A β B β C β A] with severity: warning |
get_dependency_graph | project_root, file_path, format? | Direct imports and importers for a specific file (json or mermaid) |
get_coverage_gaps | project_root, source_dirs[]?, limit? | Source files not reachable from any test β completely untested code |
get_test_summary | project_root | Coverage rate, most-imported files, deepest import chains |
refresh_project | project_root | Clears the cached AST β use after git pull or branch switch |
npm install -g ast-impact-mapper-mcp
Or build from source:
git clone https://github.com/vola-trebla/ast-impact-mapper-mcp.git
cd ast-impact-mapper-mcp
npm install && npm run build
.cursor/mcp.json or .vscode/mcp.json){
"mcpServers": {
"ast-impact-mapper": {
"command": "ast-impact-mapper-mcp"
}
}
}
claude mcp add ast-impact-mapper ast-impact-mapper-mcp
My project root is /my-project. I just changed these files from git diff:
src/utils/auth.ts
src/api/userService.ts
1. get_rename_aware_diff β which tests are affected by this branch (handles renames)?
2. differentiate_type_impact β which of those tests can I skip if the change is type-only?
3. analyze_api_surface_mutation for src/utils/auth.ts β is this a breaking API change?
4. explain_impact β why does tests/login.spec.ts care about auth.ts?
5. detect_architectural_cycles β are there any circular deps I should break first?
6. identify_unreachable_modules β which files are dead code I can safely delete?
Given a project with this structure:
src/
fixtures/base-fixture.ts β imports home-page + results-page
pages/google-home-page.ts
pages/google-results-page.ts
tests/
google-pom.spec.ts β imports base-fixture
get_affected_tests β change google-home-page.ts, find affected tests:
{
"changed_files": ["/my-project/src/pages/google-home-page.ts"],
"affected_tests": ["/my-project/tests/google-pom.spec.ts"],
"total_affected": 1
}
explain_impact β why does the spec depend on google-home-page.ts?
{
"changed_file": "/my-project/src/pages/google-home-page.ts",
"test_file": "/my-project/tests/google-pom.spec.ts",
"found": true,
"import_chain": [
"/my-project/tests/google-pom.spec.ts",
"/my-project/src/fixtures/base-fixture.ts",
"/my-project/src/pages/google-home-page.ts"
]
}
get_test_summary β project-wide health:
{
"total_source_files": 4,
"total_test_files": 1,
"covered_source_files": 3,
"coverage_rate": 0.75,
"most_imported_files": [{ "file": "src/fixtures/base-fixture.ts", "imported_by_count": 1 }],
"deepest_import_chains": [{ "test": "tests/google-pom.spec.ts", "depth": 2 }]
}
The server uses ts-morph to load your TypeScript project (with full tsconfig support, including path aliases) and builds two graphs:
get_affected_tests does a BFS through the reverse graph starting from the changed files, collecting every file that transitively depends on them, then filters to *.spec.ts / *.test.ts.
explain_impact does a BFS through the forward graph from the test file until it reaches the changed file, then reconstructs the shortest import path.
The project is cached in memory per project_root β the first call parses the AST, subsequent calls reuse it.
Together, an AI agent can give you a prioritized, minimal test run: the right tests, ranked by flakiness risk.
npm run build # compile TypeScript β dist/
npm run lint # ESLint
npm run format # Prettier --write
npm run format:check # Prettier check (used in CI)
MIT
Be the first to review this server!
by Modelcontextprotocol Β· Developer Tools
Web content fetching and conversion for efficient LLM usage
by Modelcontextprotocol Β· Developer Tools
Read, search, and manipulate Git repositories programmatically
by Toleno Β· Developer Tools
Toleno Network MCP Server β Manage your Toleno mining account with Claude AI using natural language.