AI agents (MCP)
zhttp has a built-in MCP server. While the app is open, an agent connected to it can search everything you captured, read it, work out the API behind it, send requests on a connection made like the app’s, and set up the same breakpoints, scripts and smart actions you build in the app.
Connect
Section titled “Connect”The endpoint is shown under Settings → AI agents, with a copy button:
http://127.0.0.1:8878/mcpClaude Code:
claude mcp add --transport http zhttp http://127.0.0.1:8878/mcpOther agents: add an MCP server of type HTTP (Streamable HTTP) with that URL.
The endpoint listens on 127.0.0.1 only, so only programs on this computer can reach it.
What to ask
Section titled “What to ask”- “Which endpoints does the app call after login, and which headers carry credentials?”
- “Where does the
x-session-tokenheader come from?” - “Infer a JSON Schema for the responses from
/v2/cart/items/{id}.” - “Replay the last
POST /v2/cart/itemswithquantityset to 2 and diff it against the original.” - “Which hosts refused the proxy’s certificate?”
- “Hold the next
POST /v2/checkout, changequantityto 0 and let it go.” - “Serve
C:\mock\config.jsonin place of the real/config.json.” - “Write a script that sets
premiumtotruein/v2/me, try it on the last request, then turn it on.” - “Whenever a response is a 401, highlight it red and notify me.”
- “Keep the token from the login response and send it as
Authorizationon every API request. Try it on the last login first.” - “Fail every third checkout with a 503 so I can test the retry screen.”
- “Block
ads.example.com, slow everything else to 3G, and star every failed login.” - “Export the checkout requests as a Postman collection.”
What an agent can do
Section titled “What an agent can do”Find and read
Section titled “Find and read”| Tool | Does |
|---|---|
zhttp_status |
Describes the session: its address, how to connect a phone, the certificate, counts of requests and connections, recent warnings |
zhttp_sessions |
Lists the sessions, with the names you gave their tabs and which one is open in the app |
zhttp_search_entries |
Finds requests by host, method, status, URL, header or body text, content type, connection, JA4 or time; by the quick filters (HTTP, HTTPS or WebSocket, kind of content, status class); by the program that opened the connection; or by your comments, highlights and favourites |
zhttp_get_entry |
Reads one request and its response in full, headers in the order sent, bodies decoded. Shows the connection’s program, server address and DNS, connect and TLS times, and your comment, highlight and favourite |
zhttp_save_body |
Writes a body to a file, for bodies too big to read in one go |
zhttp_connections |
Lists connections, including passed-through ones and failed handshakes such as an app pinning its certificate, with the program on this computer that opened each. Can be narrowed to one program |
zhttp_export |
Writes requests, by ID or by the search’s filters, to a recording, a HAR, a Postman collection or an OpenAPI description. Your comments go with them |
zhttp_delete_entries |
Deletes requests by ID. They leave the app’s list too, and stay gone when zhttp restarts. It can’t be undone |
Work out the API
Section titled “Work out the API”| Tool | Does |
|---|---|
zhttp_extract_endpoints |
Groups requests into endpoints such as GET /v2/cart/items/{id} |
zhttp_describe_endpoint |
Headers, query parameters and body shapes of one endpoint across its requests |
zhttp_query_body |
Pulls values out of JSON or form bodies, for example items[*].sku |
zhttp_infer_schema |
Builds a JSON Schema from several bodies |
zhttp_validate_schema |
Checks bodies against a JSON Schema |
zhttp_trace_flow |
Follows a token, cookie or ID: which response it came from and which requests sent it later |
zhttp_graphql_operations |
Lists GraphQL operations, including persisted queries |
zhttp_graphql_operation |
One GraphQL operation’s query, variables, response shape and errors |
zhttp_decode_protobuf |
Reads protobuf and gRPC bodies, using the schemas you added |
zhttp_diff_entries |
Compares two exchanges: URL, headers and their order, bodies field by field, status, fingerprints |
Fingerprints
Section titled “Fingerprints”| Tool | Does |
|---|---|
zhttp_get_tls |
One connection’s handshake: the app’s ClientHello, JA3, JA4, PeetPrint, the verdict on what the server received |
zhttp_fingerprint |
How the app presents itself: TLS, HTTP/2 and header order, grouped by client stack |
zhttp_export_profile |
A connection’s client as a tls-client (Go or JSON) or httpcloak profile |
| Tool | Does |
|---|---|
zhttp_replay |
Sends a captured request again, as it was or changed |
zhttp_compose |
Sends a new request on a connection made like a captured one’s |
zhttp_send_message |
Sends a text or binary message on an open WebSocket, to the server or to the app |
Replays and composed requests go to the real server, with the app’s fingerprint. The new exchange is captured like any other and shows in the list.
Breakpoints, maps and scripts
Section titled “Breakpoints, maps and scripts”| Tool | Does |
|---|---|
zhttp_rules |
Lists the session’s breakpoints, WebSocket breakpoints, maps to files, remote maps, scripts and extensions’ rules, those switched off too |
zhttp_add_rule |
Adds a rule of any of those kinds, with a name |
zhttp_change_rule |
Changes a rule’s name, URL, method or what it does, turns it on or off, or moves it, which sets the order scripts run in |
zhttp_remove_rule |
Removes a rule |
zhttp_held |
Lists the requests, responses and WebSocket messages breakpoints and smart actions are holding, with the rule or action that held each, its headers and body |
zhttp_release |
Lets a held message go on, as it is or changed, drops it, or answers a held request with a response of its own |
zhttp_test_script |
Runs a script on a captured request, as the Test tab does, and shows what it made and logged. Nothing is sent |
zhttp_script_log |
Reads the scripts’ console: what they logged as they ran, and why any failed. Includes what smart actions’ Run script steps logged |
zhttp_variables |
Lists the variables the scripts and smart actions share |
zhttp_set_variable |
Sets or removes a variable |
Smart actions
Section titled “Smart actions”| Tool | Does |
|---|---|
zhttp_actions |
Lists the session’s smart actions in the order they run, those switched off too, each with why it can’t run when it can’t |
zhttp_add_action |
Adds an action: its name, request or response, conditions and steps. One that can’t run is refused, naming the condition or step at fault |
zhttp_change_action |
Changes an action’s name, trigger, conditions or steps, turns it on or off, or moves it |
zhttp_remove_action |
Removes an action |
zhttp_test_action |
Tries an action on a captured request, as the Test tab does: which conditions were met and what each step did. Nothing is sent or held |
zhttp_action_log |
Reads the actions’ activity: which request each ran on, the marks and notices it made, and why a step failed |
Extensions
Section titled “Extensions”| Tool | Does |
|---|---|
zhttp_extensions |
Lists the extensions installed: which are on and running, and their rules, tabs and right-click items |
zhttp_view |
Shows a request through an extension’s tab, as the app does |
zhttp_run_command |
Runs an extension’s right-click item on requests |
Settings
Section titled “Settings”| Tool | Does |
|---|---|
zhttp_settings |
Reads the session’s settings below. Proxy passwords are never shown |
zhttp_set_pass_through |
Adds or removes hosts that SSL proxying passes through untouched |
zhttp_set_tls |
Turns SSL proxying off or on for every host, and turns Keep ECH off or on |
zhttp_set_tcp |
Sets the TCP values the session’s connections to servers use, or goes back to this computer’s own |
zhttp_set_system_proxy |
Points this computer’s proxy settings at the session, or puts them back. On macOS you’re asked for your password first |
zhttp_set_host_lists |
Adds to or removes from the block and allow lists |
zhttp_set_network |
Sets network conditions: a profile or values, the servers slowed, on or off |
zhttp_set_no_caching |
Turns No caching on or off, and adds or removes the locations it applies to |
zhttp_set_upstream |
Sets the upstream proxy: none, one proxy, or one of your proxy lists by name |
| Tool | Does |
|---|---|
zhttp_mark_entries |
Comments on requests, highlights them in a colour or stars them, or takes any of those off |
You and the agent share the same rules, smart actions, settings and marks. What the agent changes shows in the app and is saved with the session; what you change in the app is what the agent sees. When the agent lets a held message go, it leaves the Breakpoints panel.
These changes need the app open: they are made in the app and saved there.
Sessions
Section titled “Sessions”Tools read the session open in the app unless the agent asks for another. Name your tabs (double-click one, or right-click › Rename) so the agent can tell sessions apart. Recordings you open are sessions too, so an agent can read a .zhttp, HAR, Charles or powhttp file.
Exchanges changed at a breakpoint or mapped to a file appear as they went: the request as the server got it, the response as the app got it.
To serve agents without the app, see Terminal.