Portable project setup
Drop a .mcp.json at the repository root. This is the preferred setup because it is portable across every MCP-compatible client — Claude Code, Cursor, Windsurf, and anything else that reads the standard project-level file — without an editor-specific settings file.
{
"mcpServers": {
"tarn": {
"command": "tarn-mcp",
"args": []
}
}
}
Commit this file and every contributor on the project picks up the same tool surface automatically.
Available tools
tarn_list: enumerate files and steps.tarn_validate: catch syntax and config issues before execution.tarn_run: execute tests and return structured report JSON.tarn_fix_plan: prioritize failed steps and suggest next actions from the report. Shares its engine with the quick-fix code action in tarn-lsp, so CLI agents and editor agents get the same remediation graph.
tarn_run
Execute tests and return structured JSON results.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
path | string | No | workspace | Path to .tarn.yaml file or directory |
tag | string | No | - | Filter by tag (comma-separated, AND) |
env | string | No | - | Environment name (loads tarn.env.{name}.yaml) |
vars | object | No | - | Variable overrides as key-value pairs |
tarn_validate
Validate .tarn.yaml files without executing.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
path | string | Yes | - | Path to .tarn.yaml file or directory |
tarn_list
List all available tests.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
path | string | No | workspace | Path to directory |
tarn_fix_plan
Analyze a failed report and return prioritized remediation.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
path | string | No | - | Run tests first, then plan |
tag | string | No | - | Tag filter when path is provided |
env | string | No | - | Environment name when path is provided |
vars | object | No | - | Variable overrides when path is provided |
report | object | No | - | Pass a report directly |
max_items | integer | No | all | Limit failing steps in the plan |
Portable project setup
See the section above for the portable .mcp.json approach. The following editor-specific configurations are fallbacks for clients that do not yet read the project-level file — use the same mcpServers block in each client's settings.
Claude Code
# Install tarn-mcp cargo install tarn-mcp
Add to .claude/settings.json:
{
"mcpServers": {
"tarn": {
"command": "tarn-mcp",
"args": []
}
}
}
Cursor
Add to ~/.cursor/mcp.json:
{
"mcpServers": {
"tarn": {
"command": "tarn-mcp",
"args": []
}
}
}
Windsurf
Same .mcp.json configuration in the project root.
opencode
opencode does not read .mcp.json. Use its native opencode.jsonc at the repo root — note the different schema shape (mcp instead of mcpServers, type: "local" for stdio, and a command array).
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"tarn": {
"type": "local",
"command": ["tarn-mcp"],
"enabled": true
}
}
}
This repo commits a working opencode.jsonc at its root alongside a .opencode/skills/tarn-api-testing/ symlink, so agents running opencode inside the Tarn repo get the full MCP + LSP + skill surface with no extra setup. See editors/opencode/README.md for the full install flow.
Recommended loop
- Call
tarn_listto get the suite shape. - Edit or generate the Tarn YAML.
- Call
tarn_validate. - Call
tarn_run. - Call
tarn_fix_planif the run failed and you want a prioritized debugging plan.
Failures-first agent loop
1. tarn_list → discover tests 2. Generate/edit YAML 3. tarn_validate → catch syntax/config issues 4. tarn_run → execute, inspect failure_category 5. Check response body in failures to fix assertions 6. tarn_fix_plan → structured remediation 7. Fix and rerun until PASSED
Why it beats shelling out
- No stdout scraping or fragile regex around human output.
- Shared contract with the JSON report schema.
- Smaller prompt footprint because the tool result is already structured.