MCP for AI agents
Let Claude Code, Cursor, VS Code, Windsurf or Zed read your captures and, when you allow it, add rules and control capture.
WireLens for Mac includes wirelens-mcp, a Model Context Protocol server. With it, an agent in your editor can find the request behind a bug, read its body, export it, and, if you allow it, add a Map Local rule or a breakpoint to test a fix.
The server ships inside the app, at /Applications/WireLens.app/Contents/Helpers/wirelens-mcp, so it always matches the app's version.
Install#
The easiest way is Tools ▸ MCP Server, which detects the editors you have and installs the server into Cursor, Claude, VS Code, Windsurf or Zed.
To add it by hand to Claude Code:
claude mcp add wirelens -- /Applications/WireLens.app/Contents/Helpers/wirelens-mcp
Other editors take the same command in their MCP configuration: the path above, with no arguments for read-only access.
Read-only by default#
Without flags the server only reads. It can search captures, read flows and bodies, export HAR and cURL, and diagnose your setup, but it cannot change anything.
To let an agent add rules and control capture, start it with --allow-mutations:
claude mcp add wirelens -- /Applications/WireLens.app/Contents/Helpers/wirelens-mcp --allow-mutations
Tools that change things are left out of the tool list entirely when mutations are not allowed, rather than listed and refused, so an agent never wastes a turn trying one.
Tools#
Always available
| Tool | Does |
|---|---|
capture_status | Whether capture is listening, the port, decrypted hosts and certificate trust. The first call when traffic is missing. |
diagnose_setup | Ranks likely setup problems against the live state for a symptom you describe. |
list_flows, get_flow | Find flows by host, path, method and status; read one. |
get_flow_body | Read a body. Supports a JSONPath so an agent fetches only what it needs. |
search_bodies | Search inside payloads. |
list_hosts, list_sessions | Roll-ups by host and by capture run. |
list_websocket_sessions, get_websocket_messages | WebSocket connections and their frames. |
get_rules | Every rule, with ids. |
export_har, export_curl, export_session, generate_code | Take traffic elsewhere. |
proxy_env, run_guided_setup | Setup for runtimes that ignore the system proxy. |
search_docs | WireLens's built-in troubleshooting and rule guides. |
With --allow-mutations
| Tool | Does |
|---|---|
set_ssl_include, toggle_ssl_host, set_invalid_origin_exceptions | SSL Proxying |
set_allow_list, set_block_list | Allow and Block lists |
add_map_local, add_map_remote, add_rewrite, add_breakpoint, add_script_rule, add_dns_spoof, add_reverse_proxy | Rules |
set_throttle, set_network_condition_profile | Network Conditions |
toggle_rule, update_rule, remove_rule | Manage rules by id |
send_request, replay_flow | Send traffic through the proxy |
control_capture, control_system_proxy, control_certificate, ensure_ready | Drive the app |
set_setting, set_upstream_proxy, set_protobuf_schema, inject_electron, quit_app | Settings and helpers |
How it stays safe#
- Secrets are redacted. Bodies and headers come back redacted unless the agent asks for the raw value, which it should only do when you asked for it.
- Blank patterns are refused. A rule with an empty pattern used to match everything; now it is an error.
- Your capture is never at risk. The server reads the capture store through the same guarded path as the command line, which never rewrites, migrates or prunes it while the app is recording.
- Capture control asks the app. Starting capture or changing the system proxy is a request to the running app, which does the work. With WireLens closed, those tools say so instead of pretending.
- The free plan's limits apply to rules an agent adds, the same as to rules you add.
Over HTTP#
wirelens-mcp --http serves the same tools over MCP's Streamable HTTP transport on a loopback address, protected by a per-session bearer token, for clients that cannot launch a process.
Good first prompts#
- "Capture is on but I see nothing from my app. What is wrong?" The agent starts with
capture_statusanddiagnose_setup. - "Find the failing checkout request and tell me what the server said." It pages with
list_flowsand reads only the part of the body it needs. - "Mock
/v2/catalogwith an empty list so I can test the empty state." With mutations allowed, it adds a Map Local rule and verifies it withsend_request.
Something here is unclear, or wrong for your setup? Contact support or write to support@wirelens.app.