Skip to main content
Back

Mimic Uses Claude to Turn App Traffic Into Python Clients

A new open-source tool captures your mobile app traffic, then has Claude generate a typed Python client so you can script any app like a library.

Repo, Full Access
  • mimic intercepts your mobile app traffic and has Claude generate a Python client from the captured endpoints.
  • Three commands: record, learn, gen, then import the generated module.
  • Uses mitmproxy for iOS; supports cURL paste and HAR file imports for web apps.
  • Auto-refreshes rotated tokens on 401 for idempotent requests, keeping sessions alive.
  • Blocked by certificate pinning (fixable via Frida) and by DPoP sender-constrained tokens (no workaround).
  • MIT licensed, 2.6k stars, intended strictly for your own accounts and data.

Mimic is an open-source tool that records a mobile or web app’s network traffic and uses Claude to generate a Python client for the underlying API. The project targets undocumented endpoints that developers would otherwise reconstruct by inspecting proxy logs, copying authentication headers, and writing request wrappers by hand. Its repository had collected more than 2,600 GitHub stars at the time of writing.

Developers can run an app through a local proxy, capture authenticated requests from their own session, and turn the observed endpoints into named Python methods. The generated client reuses tokens, cookies, device identifiers, and other session values found in the traffic.

From capture to callable methods

Mimic’s pipeline separates the work into three stages:

  1. Capture: mitmproxy records HTTPS requests and responses from the app.
  2. Session extraction: mimic.Session identifies recurring authentication values and prepares them for replay.
  3. Client generation: Claude examines the captured endpoints and writes Python methods on top of mimic.App.

The output is ordinary Python that developers can inspect, edit, test, and commit. Generated methods can include path parameters, request-body templates, and chained calls for workflows that fetch a value from one endpoint and submit it to another.

Generation remains limited to the traffic Mimic has observed. Reaching every required screen or action during capture gives Claude more endpoint shapes, payloads, and response examples to work with.

The four-command loop

Running sh install.sh from the project checkout installs Mimic as an isolated tool and fetches uv when needed. The project launches mitmproxy through uvx, avoiding a separate global installation.

For an iPhone, the documented setup points the device’s Wi-Fi proxy at the development machine and installs the mitmproxy certificate. A typical capture and generation cycle uses four commands:

mimic record
mimic hosts
mimic learn prod-api.hingeaws.net
mimic gen prod-api.hingeaws.net
  • mimic record starts the capture proxy.
  • mimic hosts lists hosts seen in recorded traffic.
  • mimic learn inspects the requests associated with one host.
  • mimic gen writes a Python client for that host.

The project README demonstrates the result with a generated Hinge client that fetches recommendations and submits a like through named methods. Because these methods call private endpoints, their behavior can change whenever the app updates its backend.

Capture paths for phones and browsers

Mimic accepts three input paths, allowing browser-accessible services to skip device proxy configuration:

  • mitmproxy: Record traffic from a mobile app after configuring the device proxy and trusting the local certificate authority.
  • cURL: Copy a browser request as cURL and load it with Session.from_curl(text).
  • HAR: Export a browser Network panel session as an HTTP Archive and pass the file to mimic gen.

The session layer also handles some token rotation. According to the project documentation, a 401 response on an idempotent request can trigger one credential refresh from mitmweb followed by one retry. Automatic retries for POST requests are disabled by default because repeating a state-changing operation can create duplicate side effects; callers can opt in with refresh=True.

Where replay fails

Several security mechanisms can prevent capture or make recorded credentials unusable:

Mechanism What happens Available response
Certificate pinning The app rejects mitmproxy’s certificate, so Mimic receives no usable traffic. mimic unpin can configure the project’s Frida bypass on a device the developer controls.
DPoP or sender-constrained tokens Every request requires a fresh proof signed by a private key that remains on the device. Captured requests cannot be replayed without access to the signing operation.
Per-request signatures or device attestation The server validates changing cryptographic or device-bound data beyond the captured token. The generated client must reproduce the scheme, which may be impractical or unsupported.
Unobserved flows or API changes The generated module lacks required endpoints or sends outdated payloads. Record the missing workflow, regenerate the client, and review the changes.

A host listed by mimic hosts confirms that its traffic reached the proxy. Successful replay still depends on token validity, request signatures, server-side checks, and complete payloads. A missing host usually points to certificate pinning, incorrect proxy configuration, or an app flow that produced no network request.

Backend calls replace UI scripts

Direct API calls avoid the rendering delays and selector failures common in Appium scripts, browser automation, and coordinate-based tapping. Claude also receives concrete request and response payloads, giving it better material for method signatures than an API description inferred from screen behavior.

That approach can support personal data exports, account-history backups, repetitive actions on services a user already accesses, and prototypes built against undocumented backends. Generated clients still require tests and maintenance because private APIs provide no compatibility guarantee.

Treat captures as credentials

Proxy logs, HAR files, generated modules, and copied cURL commands can contain bearer tokens, cookies, personal records, and device identifiers. Store them outside public repositories, redact samples before sharing, remove the local certificate from devices after capture, and rotate exposed credentials.

Claude may receive captured payloads under the user’s configured Claude service and data-handling terms. Developers should inspect what will be transmitted, remove unnecessary personal data, and review generated code before executing it.

The author’s ethics guidance limits the intended scope to a user’s own accounts and data. App terms, workplace policies, privacy obligations, and local law continue to govern access and automation.