HTTP API

The app serves a small REST API on 127.0.0.1, authenticated with a bearer token. The CLI and MCP server are clients of it; you can call it from any language.

Authentication

Read the port and token from the app's data folder and send the token as a bearer header. The token file is created with owner-only permissions, so only the same user on the same Mac can call the API.

PORT=$(cat ~/Library/Application\ Support/elcapture/api_port)
TOKEN=$(cat ~/Library/Application\ Support/elcapture/api_token)
curl -s -H "Authorization: Bearer $TOKEN" \
  "http://127.0.0.1:$PORT/flows?filter=host:api&limit=10"

Endpoints

Method & pathDoes
GET /statusProxy address, request count, recording, system-proxy and certificate state.
GET /flows?filter=&limit=Matching requests as rows (id, method, url, status, duration, bytes, app, comment).
GET /flows/{id}?secrets=1One request as a HAR entry (redacted unless secrets).
GET /har?filter=&secrets=1Matching requests as a HAR document.
GET /rules / PUT /rulesRead or replace the rule set (JSON array).
GET /commands / POST /commandList command-palette actions, or run one by name.
POST /selectSelect a flow by id (and a tab) in the UI.
PUT /appearanceSet accent, code theme and editor font size.
POST /openOpen a URL.
POST /sendSend a raw HTTP request through the proxy.
POST /clearClear the session.
POST /recording / POST /proxyToggle recording or the system proxy ({"on": true}).

Prefer a wrapper? elcapture-cli covers the common calls; MCP exposes them to AI agents.