ต้นแบบ · รุ่นทดลอง: มีทุก server ในทะเบียนทางการ อัปเดตทุก 30 นาที รีวิวและบัญชีผู้ใช้จะมาในขั้นถัดไป
PopNx MCPที่รวม MCP สำหรับคนใช้ AI · อธิบายเป็นภาษาคน

Ast Impact Mapper MCP

โดย vola-treblaรุ่น 0.3.1i★ –iรันบนเครื่อง
ชื่อใน registryio.github.vola-trebla/ast-impact-mapper-mcp

ติดตั้ง

ภาพรวม

คำอธิบายจากผู้ทำ (ภาษาอังกฤษตามต้นฉบับ)

MCP server that uses TypeScript AST to find which tests are affected by a code change

สามเสาของ PopNx MCP

สามเรื่องนี้ไม่รวมเป็นคะแนนเดียว เพราะความเห็น การวัด และความนิยม เป็นคนละเรื่องกัน

ใช้ทำอะไรได้

ตัวนี้ยังไม่ได้เรียบเรียงเป็นภาษาไทย ด้านล่างคือข้อเท็จจริงที่เราอ่านจาก registry

  • การเชื่อมต่อ: รันบนเครื่อง
  • ช่องทาง (transport): stdio
  • หมวด: เครื่องมือนักพัฒนา

ติดตั้ง

เลือกโปรแกรม AI ที่คุณใช้ แล้วคัดลอกค่าตั้งไปวาง

ก่อนติดตั้ง

ต้องเตรียมก่อน

  • npmติดตั้ง Node.js (มีคำสั่ง npx) ในเครื่อง

คุณใช้แอปไหน

เลือกแอปด้านบน เราจำไว้ให้ ครั้งหน้าปุ่มจะขึ้นว่า “ติดตั้งลง …”

เปิด Claude Desktop → Settings → Developer → Edit Config แล้ววางค่านี้ในไฟล์ claude_desktop_config.json

{
  "mcpServers": {
    "ast-impact-mapper": {
      "command": "npx",
      "args": [
        "-y",
        "ast-impact-mapper-mcp"
      ]
    }
  }
}

พิมพ์คำสั่งนี้ใน Terminal

claude mcp add ast-impact-mapper -- npx -y ast-impact-mapper-mcp

เปิดใน Cursor

หรือคัดลอกค่าตั้งเอง

วางในไฟล์ .cursor/mcp.json ของโปรเจกต์ หรือ ~/.cursor/mcp.json

{
  "mcpServers": {
    "ast-impact-mapper": {
      "command": "npx",
      "args": [
        "-y",
        "ast-impact-mapper-mcp"
      ]
    }
  }
}

เบราว์เซอร์จะถามก่อนเปิดแอป จากนั้นแอปแสดงค่าตั้งให้ตรวจแล้วกดยืนยัน ช่อง key เว้นว่างไว้ให้คุณใส่เอง

เปิดใน VS Code

หรือคัดลอกค่าตั้งเอง

วางในไฟล์ .vscode/mcp.json ของโปรเจกต์

{
  "servers": {
    "ast-impact-mapper": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "ast-impact-mapper-mcp"
      ]
    }
  }
}

เบราว์เซอร์จะถามก่อนเปิดแอป จากนั้นแอปแสดงค่าตั้งให้ตรวจแล้วกดยืนยัน ช่อง key เว้นว่างไว้ให้คุณใส่เอง

ตัวนี้รันในเครื่องคุณ แต่ ChatGPT ต่อได้เฉพาะ server บนอินเทอร์เน็ต ลองเลือกแอปอื่น

ตัวเลือกเก็บในคุกกี้บนเครื่องนี้ ไม่ต้องมีบัญชี

ค่าตั้งนี้สร้างจากข้อมูลใน registry ของผู้ทำ ถ้าไม่ตรงกับ README ให้เชื่อ README

ทำอะไรได้บ้าง

รันในเครื่องคุณ รายการเครื่องมือจะขึ้นในแอป AI หลังติดตั้ง

ผลตรวจเบื้องต้นi

เราตรวจจากข้อมูลที่ใครก็เปิดดูได้ ยังไม่ได้อ่านโค้ด ข้อที่ไม่เกี่ยวกับตัวนี้ไม่นับในตัวหาร · ตรวจเมื่อ 9 พ.ย. 2569

  • ✓ ผ่าน

    ตัวตนผู้ทำตรงกับ repo

    ชื่อใน registry ยืนยันด้วยบัญชี GitHub vola-trebla ซึ่งเป็นเจ้าของ repo

  • … ยังไม่ตรวจ

    ยังมีคนดูแล

    ยังไม่ได้อ่านข้อมูล repo จาก GitHub

  • … ยังไม่ตรวจ

    มีสัญญาอนุญาต (license)

    ยังไม่ได้อ่านข้อมูล repo จาก GitHub

  • – ไม่เกี่ยว

    endpoint ตอบ

    ตัวนี้รันบนเครื่องคุณ ไม่มี endpoint บนอินเทอร์เน็ต

  • – ไม่เกี่ยว

    ล็อกอินแบบ OAuth

    ตัวนี้รันบนเครื่อง ใช้ค่าที่ตั้งในเครื่องแทน

  • … ยังไม่ตรวจ

    คำอธิบายเครื่องมือไม่มีคำสั่งแอบแฝง

    รันในเครื่องคุณ เราอ่านรายการเครื่องมือได้เฉพาะตัวที่มี endpoint บนอินเทอร์เน็ต

เทียบกับตัวอื่นในหมวด เครื่องมือนักพัฒนาi

  • ดาวมากกว่า 0% ของอีก 5570 ตัวในหมวดนี้
  • ส่งรุ่นใหม่เข้า registry ล่าสุดกว่า 15% ของอีก 5570 ตัวในหมวดนี้
  • ผลตรวจเบื้องต้นดีกว่าหรือเท่ากับ 100% ของอีก 5570 ตัวในหมวดนี้

เทียบกับทุก server ที่ยังใช้งานในหมวดนี้ทั้งทะเบียน ดาวนับเฉพาะเมื่อผู้ลงทะเบียนเป็นเจ้าของ repo

คำถามที่พบบ่อย

Ast Impact Mapper MCP ปลอดภัยไหม?

จากการตรวจเบื้องต้นของเรา ผ่าน 1 จาก 1 ข้อที่ตรวจได้ เรายังไม่ได้อ่านโค้ด ก่อนใส่กุญแจหรือ token ให้ดูว่า server ขอสิทธิ์อะไร และเลือกกุญแจที่ทำได้เท่าที่จำเป็น

ต้องใช้กุญแจหรือรหัสอะไรบ้าง?

registry ไม่ได้ระบุว่าต้องใช้กุญแจ แต่บางตัวจะขอให้ล็อกอินตอนใช้ครั้งแรก

ตัวนี้รันบนเครื่องหรือบนคลาวด์?

รันบนเครื่องของคุณ โปรแกรม AI จะเปิด server ขึ้นมาเองเมื่อใช้ ข้อมูลไม่ต้องผ่านเซิร์ฟเวอร์ของผู้ทำ (ยกเว้นตัวที่ไปเรียกบริการออนไลน์ต่อ)

ยังมีคนดูแลอยู่ไหม?

repo บน GitHub มีการแก้โค้ดล่าสุด – และส่งรุ่นล่าสุด (0.3.1) เข้า registry 6 เดือนที่ผ่านมา

ใช้กับโปรแกรมไหนได้บ้าง?

โปรแกรมที่รองรับ MCP เช่น Claude Desktop, Claude Code, Cursor และ VS Code ตัวนี้ต้องมี Node.js ในเครื่องด้วย

มีตัวไหนใช้แทนได้บ้าง?

ในหมวดเดียวกันมี GitHub, Desktop Commander, Cloudflare MCP

ตัวที่ใช้แทนได้

server หมวดเดียวกันจากผู้ทำคนอื่น เรียงตามดาว

อ่านการ์ด:↓ ดาวน์โหลดต่อสัปดาห์i★ ดาว GitHubiสามเสา: รีวิว · ผลตรวจ · การใช้งานiอัปเดต = วันที่ส่งรุ่นล่าสุดเข้า registryi

GitHub

server ทางการของ GitHub ให้ AI อ่านและจัดการโค้ด issue และ pull request ในบัญชีของคุณได้ ใช้ผ่านคลาวด์ของ GitHub หรือรันในเครื่องด้วย Docker ก็ได้

โดย githubใช้กันมาก★ 34.2Kอัปเดต 6 วันที่ผ่านมา

บนเครื่องหรือคลาวด์

Desktop Commander

MCP server for terminal commands, file operations, and process management

โดย wonderwhy-erใช้กันมาก↓ 709.6K/สัปดาห์★ 10.2Kอัปเดต 18 วันที่ผ่านมา

รันบนเครื่อง

Cloudflare MCP

Cloudflare MCP servers

โดย cloudflareใช้กันมาก★ 4.4Kอัปเดต 14 เดือนที่ผ่านมา

รันบนคลาวด์✓ mcp.cloudflare.com

README จากผู้ทำ

เปิดอ่าน README

ส่วนนี้คัดจาก repo ของผู้ทำตามต้นฉบับ PopNx MCP ไม่ได้ตรวจหรือรับรองเนื้อหา ตัด HTML รูปภาพ และสคริปต์ออกแล้ว ลิงก์จะพาออกนอกเว็บ

🗺️ 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 get_affected_tests 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 differentiate_type_impact 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
  • #### get_affected_tests

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.
  • #### get_affected_tests_by_branch

Automatically diffs the current state against a base branch using git to find affected tests.

  • Arguments:
  • project_root (string, required)
  • base_branch (string, default: "main"): Branch to compare against.
  • #### get_rename_aware_diff

Highly robust branch impact analysis that tracks file moves/renames (via git diff -M) and ignores formatting/whitespace changes.

  • Arguments:
  • project_root (string, required)
  • base_branch (string, default: "main")
  • similarity_threshold (number, default: 90): % similarity threshold to declare a move.
  • #### explain_impact

Traces and explains the exact chain of imports showing why a changed source file affects a specific test.

  • Arguments:
  • project_root (string, required)
  • changed_file (string, required)
  • test_file (string, required)
  • #### generate_test_command Constructs CLI commands for test runners (vitest, jest, or playwright) matching the affected tests subset.
  • Arguments:
  • project_root (string, required)
  • changed_files (string[], required)
  • runner (enum: jest, vitest, playwright, default: vitest)

2. TypeScript-specific Deep Code Analysis
  • #### differentiate_type_impact

Inspects imports and types to isolate type-only changes (interfaces, types, or import type exports). Helps skip test execution entirely if the changes do not impact the runtime bundle!

  • Arguments:
  • project_root (string, required)
  • changed_files (string[], required)
  • #### analyze_api_surface_mutation

Compares a file against its HEAD version and determines if it modifies the public API (breaking_api_change) or only contains internal implementation edits (internal_refactor).

  • Arguments:
  • project_root (string, required)
  • file_path (string, required)
  • #### generate_skeleton_view

Generates a token-optimized skeleton of a file by stripping out function and method bodies, keeping only signatures, JSDocs, and line numbers.

  • Arguments:
  • project_root (string, required)
  • file_path (string, required)
  • include_jsdoc (boolean, default: true)
  • include_private_members (boolean, default: false)
  • #### get_symbol_dependency_graph Traces declaration-level dependencies (functions, classes, variables) across files, finding internal declarations usage.
  • Arguments:
  • project_root (string, required)
  • file_path (string, required)
  • symbol_name (string, optional): Specific export symbol to map.
  • direction (enum: forward, reverse, bidirectional, default: bidirectional)

3. Codebase Health & Graph Insights
  • #### identify_unreachable_modules

Finds orphaned source files that have zero incoming imports (dead code safe to prune). Automatically respects standard entry points.

  • Arguments:
  • project_root (string, required)
  • entry_points (string[], optional): Explicit entry-points to exclude from warning.
  • limit (number, default: 50)
  • #### detect_architectural_cycles

Locates circular dependency loops (e.g. A → B → C → A) which cause unpredictable module initialization orders.

  • Arguments:
  • project_root (string, required)
  • #### get_dependency_graph

Returns direct imports/importers of a file in JSON format or as a visual Mermaid TD flowchart.

  • Arguments:
  • project_root (string, required)
  • file_path (string, required)
  • format (enum: json, mermaid, default: json)
  • #### get_coverage_gaps

Identifies files with zero import coverage — those that are never imported by any test file.

  • Arguments:
  • project_root (string, required)
  • source_dirs (string[], optional)
  • limit (number, default: 50)
  • #### get_test_summary

Provides a high-level view of test coverage rate, deepest import chains, and high-risk most-imported modules.

  • Arguments:
  • project_root (string, required)
  • #### refresh_project Invalidates AST and dependency graphs cache. Run this after checking out branches or pulling remote git updates.
  • Arguments:
  • project_root (string, required)

🚀 Installation & Setup

1. Global Installation
npm install -g ast-impact-mapper-mcp
2. Configure Editor / Agent Client
VS Code / Cursor

Add the following to your .cursor/mcp.json or .vscode/mcp.json:

{

"mcpServers": { "ast-impact-mapper": { "command": "npx", "args": ["-y", "ast-impact-mapper-mcp"] } } }

Claude Code CLI
claude mcp add ast-impact-mapper npx -- -y ast-impact-mapper-mcp

💬 Example Scenario

Imagine you modify a shared page component: src/pages/login-page.ts.

  1. AI Agent runs `get_rename_aware_diff`: It detects that only tests/auth.spec.ts imports the page object transitively.
  2. AI Agent runs `differentiate_type_impact`: It sees you only added a type definition interface, classifying it as type_only_change -> it skips running the test execution completely, saving developer cycles!
  3. AI Agent runs `explain_impact`: If asked why tests/auth.spec.ts depends on it, it renders the path: tests/auth.spec.ts → src/fixtures/app.ts → src/pages/login-page.ts.

🔗 The Ecosystem

  • `ast-impact-mapper-mcp` answers: _"Which tests are affected by my changes?"_ 🗺️
  • [`flakiness-graph-mcp`](https://github.com/vola-trebla/flakiness-graph-mcp) answers: _"Of those affected tests, which ones are historically unstable?"_ 📊
  • Together, they form a perfect feedback loop for running a prioritized, resilient, and minimal test suite.

🛠️ CLI Development

npm run build        # Compile TypeScript to dist/

npm run lint # Run ESLint validation npm run format # Format files via Prettier npm test # Run unit tests via Vitest


📄 License

MIT © vola-trebla 🐸

ถาม PopNx