
ariadne
io.github.MikhailHal由 GitHub 账号 MikhailHal 发布v0.4.0更新于 Oct 24, 2026
Returns only the unit tests affected by your current Kotlin/Android code changes.
概览
本地 MCP 服务器,分析 Kotlin/Android 代码改动并只返回受影响的单元测试,让助手运行有针对性的测试集。
- 可以做什么
- 筛选受影响测试:传入项目路径后内部执行 git diff,返回排序后的受影响测试全限定名列表。
- 选择分析范围:deep 覆盖自基准分支以来的全部改动,shallow 只覆盖相对 HEAD 的未提交改动。
- 标记无法分析的改动:当构建脚本、资源或未扫描的源码集发生变化时,附加建议运行完整测试的说明。
- 报告限制:超时或无法确定基准分支时返回明确错误。
- 适用场景
- 适用于 AI 助手在 Kotlin 或 Android 代码库中反复修改并希望只运行受改动影响的测试来快速验证的场景,而不是跑完整测试套件。适合编辑—验证的内层循环,CI 中仍应保留完整测试。
- 运行要求
- 以 stdio 方式在本地运行,可通过 Homebrew、Docker(挂载项目并将 /workspace 作为 project_path 传入)或发布版 JAR 安装。需要 JDK 21 或更高版本以及 Git;被分析的项目必须是 Git 仓库。未声明任何账号、API 密钥或环境变量。
安装
在 SourceWeft 中
- 打开 控制台中的 ariadne,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
ariadne
MCP Server for Affected Test Selection
[Release] [MCP Registry] [Homebrew] [Container image] [License] [Kotlin]
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 diffinternally - 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-<version>-all.jar from Releases (requires JDK 21+) and configure your client with "command": "java", "args": ["-jar", "/path/to/ariadne-<version>-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 projectscope(optional,deep|shallow, defaultdeep) — how far back to look:deep— all changes sincebase_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 againstHEAD). Fastest, for the tight edit loop. Verifying already-committed work is left to the caller.base_branchis ignored.
base_branch(optional,deepscope 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 passbase_branchexplicitly 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
- Agent calls tool — Passes project path to ariadne
- Run git diff — ariadne executes
git diff --unified=0against base branch - Analyze with sazanami — Build call graph and find affected tests
- Return results — List of test FQNs returned to agent
Real-World Validation: Now in Android
Measured against Now in Android (Google's reference Android app — 34 modules, ~268 Kotlin files):
Verified patterns include repositories behind project interfaces, a library-interface
override (androidx.datastore.Serializer), operator fun invoke use cases,
@Composable functions, extension mappers, ViewModel property-initializer chains,
and callable references. Two representative results:
- Changing
core:common'sasResult()selects 14 tests across three modules, including ViewModel tests reachable only throughval uiState = ...stateIn(...) - Changing the mapper
PopulatedNewsResource.asExternalModel()selects 14 tests, including 11 repository tests reachable only through.map(Type::mapper)chains
Test-class selection rate
Every unit-test class in Now in Android was measured by changing a function in the class it tests and checking whether that test class was selected:
Robolectric turned out not to be a barrier: those tests call the composable
themselves (setContent { NiaTheme { ... } }), so the call exists in the source.
What decides coverage is not the test runner but whether the test's own code
contains the call.
What ariadne cannot see
The rule of thumb: if the framework calls your code instead of your test calling it, ariadne cannot connect them. These are limits of static analysis, not bugs — plan your CI safety net around them:
Full audit notes: sazanami#29, sazanami#38.
Requirements
- JDK 21 or later
- Git — For diff detection
Limitations
- Module discovery is convention-based: it parses
settings.gradle(.kts)includes, enumeratessrc/<sourceSet>/{kotlin,java}layouts, and readsproject(":x")/ type-safe accessor dependencies from build files. Dynamic includes,projectDirremapping, customsrcDirs, and dependencies injected by convention plugins are not detected — see #1 - Full graph rebuild on each request (no caching yet); analysis is capped at 120s
- See What ariadne cannot see for analysis-level gaps
License
See LICENSE for the full text.
来源:README.md,提交 057144e
工具
0版本历史
1- v0.4.0最新Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分