Docs/Model Context Protocol

MCP Setup

Install and configure the Assrt MCP server for Claude Code, Cursor, and other coding agents.

Assrt exposes AI-powered QA testing as native tools over the Model Context Protocol (MCP). Your coding agent (Claude Code, Cursor, Windsurf, VS Code) gets three tools it can call directly: run tests, generate test plans, and diagnose failures.

Zero setup
Assrt reads your Claude Code OAuth token from macOS Keychain automatically. No API key needed, no signup, no config files. Just install and go.

Install

Claude Code

bash
claude mcp add assrt -- npx -y -p @m13v/assrt assrt-mcp

Restart Claude Code. You will see assrt in your MCP server list with three tools: assrt_test, assrt_plan, and assrt_diagnose.

Cursor / VS Code / Windsurf

Add to your editor's MCP config file (~/.cursor/mcp.json, ~/.codeium/windsurf/mcp_config.json, or VS Code settings):

mcp.jsonjson
{
  "mcpServers": {
    "assrt": {
      "command": "npx",
      "args": ["-y", "-p", "@m13v/assrt", "assrt-mcp"]
    }
  }
}

Authentication

On macOS, Assrt reads the Claude Code OAuth token from Keychain automatically. The token is read from the Claude Code-credentials keychain entry and authenticated via Authorization: Bearer with the anthropic-beta: oauth-2025-04-20 header.

On Linux or Windows (or if you prefer a separate key), set the ANTHROPIC_API_KEY environment variable instead.

Tools

Below is a quick overview of each tool. For full parameter details and response shapes, see the Tools Reference. For usage examples and common workflows, see Examples.

assrt_test

Run QA test scenarios against a URL. Launches a headless browser (1280x720 viewport), executes the test plan step by step using an AI agent, and returns a structured report with pass/fail results, assertions, evidence, and screenshots from each step.

FieldTypeDescription
urlrequiredstringURL to test (e.g. http://localhost:3000)
planrequiredstringTest scenarios in #Case N: format
modelstringLLM model override (default: claude-haiku-4-5)

The response includes JSON with passed, failedCount, scenarios[] (each with assertions and evidence), plus screenshots as image content blocks showing the browser state after each action.

assrt_plan

Auto-generate test scenarios by analyzing a URL. Launches a browser, takes screenshots at different scroll positions, reads the accessibility tree, and uses AI to create executable test cases.

FieldTypeDescription
urlrequiredstringURL to analyze
modelstringLLM model override for plan generation

Returns a test plan in #Case N: format that you can pass directly to assrt_test.

assrt_diagnose

Diagnose a failed test scenario. Analyzes the failure and provides root cause analysis, recommended fixes, and a corrected test scenario.

FieldTypeDescription
urlrequiredstringURL that was tested
scenariorequiredstringThe test scenario that failed
errorrequiredstringFailure description or error message

CLI

You can also run tests directly from the terminal or CI pipelines:

bash
npx -y -p @m13v/assrt assrt run \
  --url http://localhost:3000 \
  --plan "#Case 1: Homepage loads
Navigate to the homepage.
Verify the main heading is visible."

Use --json for structured output and --plan-file to load scenarios from a file. Exit code 0 means all tests passed, 1 means failures.

FieldTypeDescription
--urlrequiredstringURL to test
--planstringTest scenarios as inline text
--plan-filestringPath to a test plan file
--modelstringLLM model (default: claude-haiku-4-5)
--jsonflagOutput structured JSON report

Troubleshooting

Rate limits (429)
The Assrt agent shares rate limits with your active Claude Code session (same OAuth token). If you hit 429 errors, try using claude-haiku-4-5 (default, higher rate limits), waiting a few seconds and retrying, or setting ANTHROPIC_API_KEY to use a separate API key.
  • "No Claude Code credentials found": Run claude in your terminal and sign in. The OAuth token is stored in macOS Keychain under Claude Code-credentials.
  • Browser not launching: Make sure Playwright browsers are installed: npx playwright install chromium
  • macOS only for zero-auth: On Linux/Windows, set ANTHROPIC_API_KEY environment variable instead.