MCP Quickstart
Drive evals from an MCP-capable AI assistant like Claude Code or Cursor. Create, run, and calibrate evals in plain language.
Drive evals from an MCP-capable AI assistant (Claude Code, Cursor). Best for iterating with an agent that can create, run, and calibrate evals for you. Fastest path today.
The four-resource model
Every eval boils down to four resources plus a run.
Target: what to test. An HTTP agent endpoint, a prompt with a system message, or precomputed outputs.
Dataset: the test cases. Each row has an
input, and depending on scoring, optionalexpected_output,expected_tools, orcontext.Metric Set: how to score. A list of metrics with thresholds and weights.
Evaluation: the wiring. Ties the three together plus run-time settings.
Eval Run: the execution. Per-item scoring and aggregate results.
Install
The Harness MCP server ships as an npm package. The AI Evals toolset requires harness-mcp-v2 2.9.7 or later.
Configure
Claude Code reads MCP config from ~/.claude.json. Add a server entry with your Harness credentials and toolsets.
Gotchas:
ai-evalsmust be inHARNESS_TOOLSETS, or leave the variable unset to enable defaults.The AI Evals toolset key is
ai-evals(hyphenated). Some other toolsets use underscores (file_store, notfile-store); check each toolset's documentation for the exact key.Both
HARNESS_ORG/HARNESS_PROJECTandHARNESS_DEFAULT_ORG_ID/HARNESS_DEFAULT_PROJECT_IDare read by different code paths. Set both.After editing, kill running processes and reconnect:
pkill -9 -f harness-mcp-v2, then/mcpin your client.
Build your first evaluation
The example evaluates a flight support agent. Substitute your own endpoint everywhere it appears below.
Six MCP calls take you from zero to a scored run.
1. Create the target
Sanity-check the target first. Run harness_execute resource_type=eval_target action=test with a real input. If the agent does not return a real answer here, none of your evals will run.
2. Create the dataset
expected_tools drives trajectory metrics. expected_output drives answer metrics.
3. Find metric UUIDs
Metrics are pre-seeded per account. Search for the ones you want:
4. Create the metric set
5. Create the evaluation
6. Run it
The response includes a run UUID and a pipeline_execution_id. The runner is a Harness pipeline using harnessdev/ai-evals-runner.
7. Read results
The run returns summary_scores, dimension_scores, and pass/fail counts. Items return per-row input, output, per-metric scores, and any error messages.
What success looks like
A working MCP run returns aggregate scores plus per-item results:
What the scores mean:
pass_rate: 0.83: 83% of dataset rows passed all metrics
dimension_scores: Average scores per metric category (trajectory = tool metrics, correctness = answer metrics)
Status: completed: Run finished successfully (other states:
running,failed,cancelled)
Open the Evaluations tab in the AI Evals UI to see the same run with the full trace side by side.
Natural language alternative
Once MCP is connected, you can also describe what you want in plain language:
Claude translates that into the six MCP calls above and returns the run results.
Troubleshooting
Agent target returns HTTP 400 error with message about unexpected input structure
Without request_template on an agent target, the runner double-nests row input. Your agent receives {input: {input: ...}} instead of the expected structure and rejects with HTTP 400. Always specify the outgoing body shape explicitly on type: agent targets using the request_template field.
MCP server changes in ~/.claude.json are not taking effect after restart
Claude Code caches MCP server processes. Editing ~/.claude.json does not automatically re-spawn them. Run pkill -9 -f harness-mcp-v2 to kill the cached process, then run /mcp in the client to reconnect. Restarting the terminal alone is not enough.
Last updated
Was this helpful?