# MCP for AI agents · Docs | Lagsmith

> Add Lagsmith’s MCP server to Claude Code with one command, or to Cursor, Codex, Claude Desktop and Windsurf, and test apps on slow and failing networks.

Source: https://lagsmith.com/docs/mcp

# MCP for AI agents

Lagsmith has an MCP server built in. AI coding agents that support MCP, including Claude Code, Cursor, Codex, Claude Desktop and Windsurf, can use it to:

-   list simulators and apps,
-   set and reset an app’s network,
-   relaunch an app with request monitoring,
-   read its requests,
-   fail or mock endpoints.

Because Lagsmith only slows down the app under test, the agent’s own connection stays at full speed.

The MCP server ships inside the app at `/Applications/Lagsmith.app/Contents/MacOS/lagsmith-mcp`, so Lagsmith needs to be in your Applications folder. Automation, including MCP, is part of Pro and included in the 14-day trial.

## Claude Code

Run this once in Terminal:

```
claude mcp add --scope user lagsmith -- "/Applications/Lagsmith.app/Contents/MacOS/lagsmith-mcp"
```

`--scope user` makes Lagsmith available in every project. Start a new Claude Code session and run `/mcp` to check it’s connected.

## Cursor

Add this to `~/.cursor/mcp.json` (or `.cursor/mcp.json` in a project):

~/.cursor/mcp.json

```
{
  "mcpServers": {
    "lagsmith": {
      "command": "/Applications/Lagsmith.app/Contents/MacOS/lagsmith-mcp"
    }
  }
}
```

## Codex

Add this to `~/.codex/config.toml`:

~/.codex/config.toml

```
[mcp_servers.lagsmith]
command = "/Applications/Lagsmith.app/Contents/MacOS/lagsmith-mcp"
```

## Claude Desktop

In Claude Desktop, open Settings › Developer › Edit Config and add:

~/Library/Application Support/Claude/claude\_desktop\_config.json

```
{
  "mcpServers": {
    "lagsmith": {
      "command": "/Applications/Lagsmith.app/Contents/MacOS/lagsmith-mcp"
    }
  }
}
```

Then restart Claude Desktop.

## Windsurf

Add this to Windsurf’s MCP config:

~/.codeium/windsurf/mcp\_config.json

```
{
  "mcpServers": {
    "lagsmith": {
      "command": "/Applications/Lagsmith.app/Contents/MacOS/lagsmith-mcp"
    }
  }
}
```

If your config file already has other servers, add the `lagsmith` entry inside the existing `mcpServers` section rather than replacing the file.

## Tools

Lagsmith’s MCP server gives agents 10 tools:

| Tool | What it does | Main parameters |
| --- | --- | --- |
| `list_targets` | Running simulators and their apps, running Mac apps, presets and current rules | none |
| `status` | Every rule, what it’s doing, and whether the proxy is running | none |
| `set_network` | Slow down or break one app’s network | app, simulator; preset, or down/up (kbps), latency/jitter (ms), loss (%); failure (airplane, refuse, timeout, drop, outages); hosts, hosts\_mode |
| `reset_network` | Back to full speed; the app stays watched | app, simulator |
| `stop_watching` | Turn the app’s rule off entirely | app, simulator |
| `relaunch_app` | Relaunch a simulator app with request monitoring | app, simulator |
| `get_requests` | The app’s recent HTTP requests, newest first | app, simulator, limit, filter (e.g. is:failed, status:5xx), include\_bodies |
| `fail_endpoint` | Make one endpoint fail while the rest works | app, simulator, pattern, kind (offline, timeout, status, delay), value |
| `mock_endpoint` | Answer one endpoint with a made-up response | app, simulator, pattern, status, body, content\_type, delay |
| `clear_endpoints` | Remove endpoint failures and mocks | app, simulator, pattern |

## What a session looks like

```
> Run the checkout UI tests on 3G with the payments API returning 503s, and tell me what breaks.

⏺ I’ll find the app in the simulator first.

⏺ lagsmith - list_targets (MCP)

  ⎿  simulators: iPhone 17 Pro (booted)
     apps: com.pantryhq.Pantry, com.apple.mobilesafari, …
     presets: Edge, 3G, DSL, LTE, WiFi, Very Bad Network, 100% Loss

⏺ lagsmith - set_network (MCP)(app: "com.pantryhq.Pantry", simulator: "booted", preset: "3G")

  ⎿  {"ok": true, "rule": "Pantry", "preset": "3G",
      "conditions": {"down": 780, "up": 330, "latency": 200}}

⏺ lagsmith - fail_endpoint (MCP)(app: "com.pantryhq.Pantry", simulator: "booted", pattern: "api.pantryhq.app/v1/payments", kind: "status", value: 503)

  ⎿  {"ok": true, "endpoints": [{"pattern": "api.pantryhq.app/v1/payments",
      "kind": "status", "value": 503}]}

⏺ lagsmith - relaunch_app (MCP)(app: "com.pantryhq.Pantry", simulator: "booted")

  ⎿  {"ok": true, "relaunched": ["Pantry on iPhone 17 Pro"]}

⏺ Bash(xcodebuild test -scheme PantryUITests -only-testing:PantryUITests/CheckoutTests -destination 'platform=iOS Simulator,name=iPhone 17 Pro')

  ⎿  Test Suite 'CheckoutTests' started
     ✓ testCartLoads (4.8 s)
     ✓ testApplyCoupon (6.1 s)
     ✗ testPlaceOrder (30.0 s): Failed to find "Order confirmed" within 30 s
     Executed 3 tests, with 1 failure

⏺ lagsmith - get_requests (MCP)(app: "com.pantryhq.Pantry", simulator: "booted", filter: "host:api.pantryhq.app is:failed", include_bodies: true)

  ⎿  POST https://api.pantryhq.app/v1/payments 503 injected by Lagsmith 2 ms
     POST https://api.pantryhq.app/v1/payments 503 injected by Lagsmith 1 ms
     POST https://api.pantryhq.app/v1/payments 503 injected by Lagsmith 1 ms
     (3 requests, 0.4 s apart)

⏺ lagsmith - reset_network (MCP)(app: "com.pantryhq.Pantry", simulator: "booted")

  ⎿  {"ok": true, "preset": "No Throttling"}

⏺ Found it. On 3G the cart and coupon flows are fine, but when payments returns 503: 1. PaymentService retries 3 times with no backoff (0.4 s apart), then gives up silently. 2. The checkout screen keeps its spinner forever: there’s no error state for a failed payment, so testPlaceOrder times out waiting for "Order confirmed". Want me to add exponential backoff and an error state with a "Try again" button in CheckoutView, then rerun the tests under the same conditions?
```

Illustrative Claude Code session using Lagsmith’s MCP server. Your agent stays at full speed; only Pantry is on 3G.

## Example prompts

-   “Relaunch the app on 3G with monitoring, sign in, and list requests slower than two seconds.”
-   “Put the app in Airplane Mode and check that the offline banner appears.”
-   “Make POST /v1/orders return 500 and check the app shows a retry button.”

## Slow down one app, not your whole Mac

Free to download, with a 14-day Pro trial. No account, no card. Requires macOS 13 Ventura or later.

[Download for Mac](https://lagsmith.com/download) [Compare with Network Link Conditioner](https://lagsmith.com/network-link-conditioner-alternative)
