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:
| Ability | Grants |
|---|---|
mcp:read | Read projects, scripts, runs and metrics |
mcp:write | Create and edit scripts |
mcp:run | Start and cancel runs |
The token is shown once — copy it straight into your client config.
Client configuration
Claude Code
BASHclaude 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
| Tool | Ability | Description |
|---|---|---|
list-projects | read | Projects and their tests |
get-test-context | read | Target URL, connectors, scripts and recent runs for a test |
create-script | write | Create a new script for a test |
update-script | write | Replace a script's entry point |
validate-script | read | k6 inspect + structural checks |
list-script-files / read-script-file | read | Browse a script folder |
write-script-file / rename-script-file / delete-script-file | write | Edit a script folder |
get-script-insights | read | Recent run results for a script |
Runs
| Tool | Ability | Description |
|---|---|---|
start-run | run | Queue a run for a script |
get-run-status | read | Poll a run's status |
cancel-run | run | Cancel a queued or running run |
list-runs | read | Runs for a test or script |
get-run-context | read | Summary metrics, thresholds and config |
get-run-metrics | read | InfluxDB time-series for a run |
read-run-log | read | Raw k6 console output |
get-run-insight | read | The AI insight report, if generated |
Observability
| Tool | Description |
|---|---|
prometheus-query / prometheus-query-range | PromQL against an attached Prometheus connector |
prometheus-list-metrics / prometheus-metadata | Discover available metrics |
database-metrics | PostgreSQL / MySQL / MongoDB statistics |
redis-metrics | Redis server statistics |
Typical workflow
list-projects, thenget-test-contextfor the target URL, connectors and existing scripts.create-script(orupdate-script/write-script-file), thenvalidate-scriptand fix any issues.start-run, then pollget-run-statusevery ~10 seconds until it'spassed,failed,abortedorerror.- Analyse with
get-run-context,get-run-metrics,read-run-logandget-script-insights; correlate with the Prometheus, database and Redis tools. - Fix the script or the application under test, and repeat.