Playwright MCP Server

Dynamic network chaos in Playwright: 503s, latency, mid-flight drops

Local serverstdioTypeScript

What is the Playwright MCP server?

Playwright MCP server exists for a simple reason — assistants are far more useful when they can act on Playwright directly instead of describing what you should do. Dynamic network chaos in Playwright: 503s, latency, mid-flight drops.

What you get

An MCP server that gives AI agents dynamic network chaos control over Playwright browser sessions.

What the assistant can call

Once Playwright is connected, these are the calls the assistant has available:

  • simulate_api_failure — Intercepts requests matching a pattern and forces them to return an error status code. Checks if the app shows a fallback UI
  • inject_latency — Adds artificial delay to matching requests. Checks if loading states appear while the app waits
  • block_resources — Aborts requests to specified URL patterns — for testing third-party outages (analytics, CDNs, tracking pixels)
  • simulate_network_drop — Aborts requests mid-flight after a delay — simulating connection loss between request and response
  • trigger_system_network_error — Aborts requests with an OS-level error code — simulating DNS failures, firewall blocks, and connection resets
  • simulate_stateful_failure — Fails the first N requests then lets subsequent ones succeed — testing retry logic and recovery flows
  • inject_response_corruption — Serves malformed responses at the protocol level — unterminated JSON, content-length lies, or truncated payloads
  • assert_chaos_handled — Injects a chaos HTTP status and returns a structured pass/fail verdict — chaos_survived is true only when the fallback UI appears and there are no

Setting it up

playwright-network-chaos-mcp on npm is all you need. Most clients run it directly, so configuration is a few lines and a restart.

Choosing this one

Plenty of browser automation servers cover similar ground. The differences that matter in practice are scope of access and how much setup stands between you and a working tool call. Playwright's toolset — simulate_api_failure, inject_latency, block_resources and 5 more — is a fair guide to whether it matches your workflow.

We check each listing at SyncDev against the project's documentation before it goes live — if something here drifts out of date, it is a bug worth reporting.

Before you rely on it

  • It runs with your machine's permissions. That is convenient and also the reason to think about what you point it at before you approve a tool call.
  • MCP clients confirm each tool call by default. Leave that on until you have watched what the playwright mcp server does with a few real requests.

Available tools

ToolWhat it does
simulate_api_failureIntercepts requests matching a pattern and forces them to return an error status code. Checks if the app shows a fallback UI.
inject_latencyAdds artificial delay to matching requests. Checks if loading states appear while the app waits.
block_resourcesAborts requests to specified URL patterns — for testing third-party outages (analytics, CDNs, tracking pixels).
simulate_network_dropAborts requests mid-flight after a delay — simulating connection loss between request and response.
trigger_system_network_errorAborts requests with an OS-level error code — simulating DNS failures, firewall blocks, and connection resets.
simulate_stateful_failureFails the first N requests then lets subsequent ones succeed — testing retry logic and recovery flows.
inject_response_corruptionServes malformed responses at the protocol level — unterminated JSON, content-length lies, or truncated payloads.
assert_chaos_handledInjects a chaos HTTP status and returns a structured pass/fail verdict — chaos_survived is true only when the fallback UI appears and there are no unhandled JS exceptions.

How to install the Playwright MCP server

{
  "mcpServers": {
    "playwright-network-chaos-mcp": {
      "command": "npx",
      "args": ["-y", "playwright-network-chaos-mcp"]
    }
  }
}

Configuration as documented by the project. Restart the client after saving.

Example prompts to try

  • Use Playwright to simulate api failure.
  • Use Playwright to inject latency.
  • Use Playwright to block resources.

Frequently asked questions

It connects Playwright to MCP-compatible AI assistants such as Claude and Cursor, exposing 8 tools (simulate_api_failure, inject_latency, block_resources, and more) that the assistant can call on your behalf. Instead of copying data back and forth by hand, the assistant works with Playwright directly.