ariadne
以下摘录自该仓库的 README(片段) · 在 GitHub 读完整 README →
MCP Server for Affected Test Selection
**ariadne** is an MCP (Model Context Protocol) server that provides AI agents with the ability to identify affected tests. Powered by sazanami, it analyzes code changes and returns only the tests that need to be run.
> [!IMPORTANT]
> ## ⚠️ MUST READ: Speed over Completeness
>
> ariadne is built for the agent inner loop — edit, verify, commit — where fast
> feedback matters more than exhaustive selection. Static analysis cannot trace
> every execution path: reflection, DI frameworks, and data-flow indirection
> (e.g., Flux/MVI dispatch) can hide dependencies from **any**
> affected-test-selection tool, not just ariadne.
>
> **Always keep a final line of defense in CI.** Run the full test suite (or a
> conservative selection) before merging. ariadne narrows what an agent runs
> while iterating; it is not a replacement for CI.
>
> When ariadne detects changes it cannot analyze (build scripts, resources,
> unscanned source sets), it says so explicitly in the tool response instead of
> silently reporting "no affected tests".
Features
- **MCP Integration** — Works with Claude Code, Claude Desktop, and other MCP-compatible clients
- **Automatic Git Diff** — No need to pass diff manually; ariadne runs git diff internally
- **Powered by sazanami** — Uses Kotlin Analysis API for accurate static analysis
Installation
Homebrew (recommended)
Then register it with your MCP client — for Claude Code:
Or add to your MCP client configuration manually (e.g., Claude Desktop):
Docker
Mount the project you want analyzed and pass /workspace as project_path.
The image is also listed in the official MCP Registry as io.github.MikhailHal/ariadne.
Manual (release JAR)
Download ariadne- -all.jar from Releases (requires JDK 21+) and configure your client with "command": "java", "args": ["-jar", "/path/to/ariadne- -all.jar"].
Build from Source
Usage
Once configured, AI agents can use the get_affected_tests tool:
Tool: get_affected_tests
**Parameters:**
- project_path (required) — Path to the Kotlin project
- scope (optional, deep | shallow, default deep) — how far back to look:
- **deep** — all changes since base_branch (committed *and* uncommitted). Safest; the whole branch is covered so nothing you already committed slips through unverified. May select more tests.
- **shallow** — uncommitted changes only (diff against HEAD). Fastest, for the tight edit loop. Verifying already-committed work is left to the caller. base_branch is ignored.
- base_branch (optional, deep scope only) — Branch to compare against. When omitted, ariadne uses the repository's default branch (origin/HEAD). If that is not set (e.g. a repo with no remote), it returns an error asking you to pass base_branch explicitly rather than guessing.
**Returns:**
- List of affected test FQNs (fully qualified names), sorted
- If the diff contains changes outside the analyzed Kotlin sources (build scripts,
resources, unscanned source sets), a note is appended recommending a full test run
for those changes
- Analysis is bounded by a 120s timeout; on timeout an explicit error is returned
Example
Agent request:
Response:
How It Works
1. **Agent calls tool** — Passes project path to ariadne
2. **Run git diff** — ariadne executes git diff --unified=0 against base branch
3. **Analyze with sazanami** — Build call graph and find affected tests
4. **Return results** — List of test FQNs returned to agent