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.

Mac

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:

bash
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:

bash
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

ToolDoes
capture_statusWhether capture is listening, the port, decrypted hosts and certificate trust. The first call when traffic is missing.
diagnose_setupRanks likely setup problems against the live state for a symptom you describe.
list_flows, get_flowFind flows by host, path, method and status; read one.
get_flow_bodyRead a body. Supports a JSONPath so an agent fetches only what it needs.
search_bodiesSearch inside payloads.
list_hosts, list_sessionsRoll-ups by host and by capture run.
list_websocket_sessions, get_websocket_messagesWebSocket connections and their frames.
get_rulesEvery rule, with ids.
export_har, export_curl, export_session, generate_codeTake traffic elsewhere.
proxy_env, run_guided_setupSetup for runtimes that ignore the system proxy.
search_docsWireLens's built-in troubleshooting and rule guides.

With --allow-mutations

ToolDoes
set_ssl_include, toggle_ssl_host, set_invalid_origin_exceptionsSSL Proxying
set_allow_list, set_block_listAllow and Block lists
add_map_local, add_map_remote, add_rewrite, add_breakpoint, add_script_rule, add_dns_spoof, add_reverse_proxyRules
set_throttle, set_network_condition_profileNetwork Conditions
toggle_rule, update_rule, remove_ruleManage rules by id
send_request, replay_flowSend traffic through the proxy
control_capture, control_system_proxy, control_certificate, ensure_readyDrive the app
set_setting, set_upstream_proxy, set_protobuf_schema, inject_electron, quit_appSettings 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_status and diagnose_setup.
  • "Find the failing checkout request and tell me what the server said." It pages with list_flows and reads only the part of the body it needs.
  • "Mock /v2/catalog with an empty list so I can test the empty state." With mutations allowed, it adds a Map Local rule and verifies it with send_request.

Something here is unclear, or wrong for your setup? Contact support or write to support@wirelens.app.