# LoadFocus for AI agents

> One page with everything an AI agent or agent developer needs to drive LoadFocus: MCP server, API key auth, npm CLI, and the REST verdict API. Human docs: https://loadfocus.com/docs/

LoadFocus runs cloud load tests (plain HTTP, JMeter, k6), API monitors and page speed checks from 25+ regions. Everything below works on the free plan unless noted.

## 1. Connect over MCP (recommended)

The MCP server exposes ~50 tools: create and run load tests (cloud, JMeter, k6), fetch results and timeseries, get pass/fail verdicts, manage API monitors and page speed checks, and read plan limits.

- Endpoint: `https://mcp.loadfocus.com/api` (streamable HTTP)
- Auth headers: `loadfocus-auth: <API_KEY>` and `team-id: <TEAM_ID>`
- Get your key and team id: https://loadfocus.com/account/api-keys (free account: https://loadfocus.com/pricing)

Claude Code:

```bash
claude mcp add loadfocus --transport http https://mcp.loadfocus.com/api \
  --header "loadfocus-auth: $LOADFOCUS_API_KEY" --header "team-id: $LOADFOCUS_TEAM_ID"
```

Cursor or any MCP client: add a streamable HTTP server with the same URL and headers.

Setup and connection walkthrough: https://loadfocus.com/docs/guides/mcp and https://loadfocus.com/mcp/connect

## 2. REST API essentials

Base URL `https://loadfocus.com`. Auth: `loadfocus-auth: <API_KEY>` header (plus `team-id: <TEAM_ID>`). Engines map to paths: cloud tests `/api/v1/loadtests`, JMeter `/api/v1/jmetertests`, k6 `/api/v1/k6tests`.

Run a saved test and gate on the result (the CI pattern):

```bash
# trigger a saved test
curl -X POST "https://loadfocus.com/api/v1/loadtests/newtest/execute?testrunname=MyTest" \
  -H "loadfocus-auth: $LOADFOCUS_API_KEY" -H "team-id: $LOADFOCUS_TEAM_ID" \
  --data-urlencode "testrunname=MyTest"

# poll state until finished, then read the verdict
curl "https://loadfocus.com/api/v1/loadtests/verdict?testrunname=MyTest&testrunid=<RUN_ID>" \
  -H "loadfocus-auth: $LOADFOCUS_API_KEY" -H "team-id: $LOADFOCUS_TEAM_ID"
```

The verdict response is `{"verdict": "pass" | "fail" | "none", "checks": [...], "metrics": {...}}`. `none` means no thresholds are configured. Set thresholds as code with `PUT /api/v1/loadtests/thresholds`.

GitHub Actions: use the LoadFocus load test action (wraps trigger, polling and the verdict gate). See https://loadfocus.com/docs/ for CI recipes.

## 3. Monitoring as code (npm CLI)

```bash
npx @loadfocus/monitoring init   # scaffold loadfocus.config.yaml + monitors/
npx @loadfocus/monitoring test   # validate + dry-run against your account
npx @loadfocus/monitoring deploy # reconcile monitors, alerts, status pages
```

Monitors, alert channels, variables and status pages are YAML files you keep in git. Guide: https://loadfocus.com/docs/guides/monitoring-as-code

## 4. Share results

Every finished load test can be shared: a public read-only report page plus a live SVG badge (verdict, virtual users, p95) for a README. Guide: https://loadfocus.com/docs/guides/load-testing/share-load-test-reports

## Limits and plans

Free plan: up to 10 virtual users per load test, 60 second runs, daily/monthly run caps, API monitoring and page speed checks included. Paid plans raise virtual users, duration, parallel runs and regions: https://loadfocus.com/pricing

## More machine-readable pages

- https://loadfocus.com/llms.txt (site overview for LLMs)
- https://loadfocus.com/index.md (homepage mirror)
