MCP Server

Straden exposes a Model Context Protocol server, so AI assistants and IDEs such as Claude Code, Cursor or VS Code can write k6 scripts, run them and analyse the results against your Straden instance.


Endpoint

POST https://<your-straden-domain>/mcp
Authorization: Bearer <token>

The server uses streamable HTTP, is authenticated with Laravel Sanctum and is rate limited to 120 requests per minute per user.

Create a token

Go to Settings → API tokens, name the token, choose an expiry (30, 90, 365 days or never) and select its abilities:

AbilityGrants
mcp:readRead projects, scripts, runs and metrics
mcp:writeCreate and edit scripts
mcp:runStart and cancel runs

The token is shown once — copy it straight into your client config.

Client configuration

Claude Code

BASH
claude mcp add --transport http straden https://straden.example.com/mcp \
  --header "Authorization: Bearer $STRADEN_TOKEN"

Generic JSON config (Cursor, VS Code, …)

JSON
{
  "mcpServers": {
    "straden": {
      "url": "https://straden.example.com/mcp",
      "headers": { "Authorization": "Bearer <token>" }
    }
  }
}

Tools

Projects & scripts

ToolAbilityDescription
list-projectsreadProjects and their tests
get-test-contextreadTarget URL, connectors, scripts and recent runs for a test
create-scriptwriteCreate a new script for a test
update-scriptwriteReplace a script's entry point
validate-scriptreadk6 inspect + structural checks
list-script-files / read-script-filereadBrowse a script folder
write-script-file / rename-script-file / delete-script-filewriteEdit a script folder
get-script-insightsreadRecent run results for a script

Runs

ToolAbilityDescription
start-runrunQueue a run for a script
get-run-statusreadPoll a run's status
cancel-runrunCancel a queued or running run
list-runsreadRuns for a test or script
get-run-contextreadSummary metrics, thresholds and config
get-run-metricsreadInfluxDB time-series for a run
read-run-logreadRaw k6 console output
get-run-insightreadThe AI insight report, if generated

Observability

ToolDescription
prometheus-query / prometheus-query-rangePromQL against an attached Prometheus connector
prometheus-list-metrics / prometheus-metadataDiscover available metrics
database-metricsPostgreSQL / MySQL / MongoDB statistics
redis-metricsRedis server statistics

Typical workflow

  1. list-projects, then get-test-context for the target URL, connectors and existing scripts.
  2. create-script (or update-script / write-script-file), then validate-script and fix any issues.
  3. start-run, then poll get-run-status every ~10 seconds until it's passed, failed, aborted or error.
  4. Analyse with get-run-context, get-run-metrics, read-run-log and get-script-insights; correlate with the Prometheus, database and Redis tools.
  5. Fix the script or the application under test, and repeat.