mcptest docs GitHub

mcp-server

mcptest mcp-server is a stdio MCP server that exposes the mcptest engine to local agents. It lets you ask Claude Code, Cursor, or any MCP-aware client questions like "which tests just failed?" or "show me the cassette for the create_issue path" without leaving your editor.

The MCP server is a subcommand of the main mcptest binary, so you install one CLI and get both the test runner and the agent surface.

Run this example. examples/mcp-server-config/ registers the mcptest stdio MCP server in Claude Code or Cursor, with a read-only config and a read-write variant.

mcptest mcp-server --workspace .

Install

cargo install mcptest
# or build from the workspace:
cargo build --release -p mcptest

The release binary lands at target/release/mcptest.

Register

Claude Code

Edit .claude/mcp.json in your project root:

{
  "mcpServers": {
    "mcptest": {
      "command": "/absolute/path/to/mcptest",
      "args": ["mcp-server", "--workspace", "."]
    }
  }
}

Add "--enable-writes" to the args array if you want the agent to be able to trigger runs and record cassettes.

Cursor

Settings, MCP servers, add a stdio server with the same command and args.

mcp-inspector

For interactive exploration:

npx @modelcontextprotocol/inspector mcptest mcp-server --workspace .

The inspector UI lets you call every tool manually and inspect the resource catalog without writing agent code.

Tools

Read-only tools are always available. Write tools require --enable-writes.

ToolModeWhat it does
list_runsreadLists recent run JSON files in the cache. limit argument (default 20).
get_runreadReturns one run by run_id.
list_cassettesreadLists cassette files under <workspace>/.mcptest/cassettes/.
get_cassettereadReturns one cassette by name (with or without extension).
get_coveragereadReturns the coverage block from the most recent run.
get_doctor_reportreadSpawns mcptest doctor and returns its output.
trigger_runwriteSpawns mcptest run; accepts optional filter and profile strings.
record_cassettewriteSpawns mcptest record --cassette <cassette_name>.

Resources

URIContent
mcptest://runs/recentJSON array of recent runs in the workspace
mcptest://configYAML rendering of mcptest.yml
mcptest://cassettes/{name}Cassette content by stem

The server advertises resources.subscribe so a future revision can stream filesystem-watch updates. The current binary returns the snapshot on each resources/read; subscription delivery is wired through the notify crate in the main loop.

Agent workflows

A short menu of prompts that exercise the tools:

Workspace layout

By default the server reads:

You can point a workspace at custom directories programmatically via Workspace::with_paths if you embed the server in another binary.

Security

The read-only tools touch only files the calling user can already read. Write tools spawn mcptest subprocesses, so they inherit your normal permissions; the server adds no escalation of its own. Keep --enable-writes off for production agents you do not fully trust.