Skip to main content

motim

Model Over Traffic — Intercept & Manage

Browse any website. motim captures every request. Now your AI agent can replay them — auth included.

pip install motim
motim init          # trust CA cert, create config
motim start         # proxy on localhost:8080
# browse normally...
motim search --host api.notion.com
motim replay 42     # exact same request, same cookies, same tokens

What it does

motim runs a local MITM proxy that records full HTTP(S) exchanges — method, URL, headers, cookies, request body, response body — into a local SQLite database (~/.motim/motim.sqlite3).

Then you search, inspect, replay, mutate, diff, and probe those exchanges from the CLI or Python. Auth just works because motim captured the real headers your browser sent.

Who it's for

  • AI agents that need to call authenticated APIs without manual credential wiring
  • Security researchers probing endpoints, diffing responses, finding hidden parameters
  • Developers reverse-engineering undocumented APIs or debugging request flows
  • CTF players replaying complex auth flows

Usage

Search and inspect

motim search --host api.example.com --status 200 --method POST
motim show 42                    # full request + response
motim cat 42                     # just the response body (pipe to jq)
motim cat 42 --request           # just the request body
motim export 42                  # as a runnable curl command
motim endpoints --service notion # discovered endpoint patterns

Replay and mutate

motim replay 42                                          # as-is
motim replay 42 --set-header "x-foo=bar"                 # add/override headers
motim replay 42 --drop-header "authorization"            # strip headers
motim replay 42 --patch-json '{"page_size": 50}'         # patch JSON body
motim replay 42 --transport curl --impersonate chrome    # browser TLS fingerprint

Probe (automated mutation testing)

motim probe 42 \
  --patch-json '{"admin": true}' \
  --patch-json '{"role": "superuser"}' \
  --drop-header "x-csrf-token" \
  --json

Replays a baseline, then each mutation. Diffs every result against the baseline.

Timeline

motim around 42 --window 60      # exchanges ±60s from exchange 42
motim session 42 --gap 120       # session slice (gap-based splitting)
motim diff 42 43                 # diff two exchanges
motim replay-seq 10 11 12 13     # replay a sequence in order

JS endpoint extraction

motim linkfinder --host app.example.com --regex '^/api/'
motim js-endpoints --service example

Extracts API routes from captured JavaScript bundles — finds endpoints before you click the UI path that triggers them.

Everything else

motim services                # list captured services
motim export-yaml notion      # YAML summary export
motim rebuild-index           # rebuild derived indexes
motim doctor                  # health check
motim config show             # view config

Python library

from motim import get, Client, ExchangeDB

# One-liner
r = get("api_notion_com", "/v1/users/me")

# Client
client = Client("notion")
r = client.get("/v1/users/me")

# Direct DB access
with ExchangeDB("~/.motim/motim.sqlite3") as db:
    results = db.search_exchanges(host="api.notion.com", limit=10)

Agent integration

motim ships a skill file so AI agents know how to use it. All commands support --json for machine-readable output.

motim init                  # installs to ~/.claude/skills/motim/ (Claude Code)
motim agents-md             # writes AGENTS.md for Codex, opencode, etc.

Setup

motim init does everything: creates ~/.motim/, generates a mitmproxy CA cert, trusts it in your system keychain, and installs the agent skill.

After motim start, point your browser at localhost:8080. Use SwitchyOmega or set it system-wide.

Config lives at ~/.motim/config.yaml — header profiles, timeouts, domain filters. Run motim config show to see it.

Development

git clone https://github.com/vaibhavk97/motim.git
cd motim
pip install -e ".[dev]"
pytest

License

MIT

Metadata

Release files for motim 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for motim 0.2.1
File Size Uploaded Provenance Actions
motim-0.2.1.tar.gz 65.4 kB Without provenance Details for motim-0.2.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for motim 0.2.1
File Interpreter ABI Platform Actions
motim-0.2.1-py3-none-any.whl Python 3 none any Details for motim-0.2.1-py3-none-any.whl

Total release size: 139.0 kB

Release files / motim-0.2.1.tar.gz

Download URL motim-0.2.1.tar.gz
Size 65.4 kB
Tags Source
SHA-256 checksum
How to use checksums
5bd45a22fa8e5d27e239f932838cafa88e9aabb2499be4369a7e813047db7f51
BLAKE2b-256 checksum
How to use checksums
cc8b9e22a6641bd74c75c345f179168c14cd25693793c1004b14613a6b5476a8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.9

Release files / motim-0.2.1-py3-none-any.whl

Download URL motim-0.2.1-py3-none-any.whl
Size 73.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
37013f8c37d9cd81faa3bd66bfa4227fa330cc58c63fe456a2035d58df0fc616
BLAKE2b-256 checksum
How to use checksums
9be7fc064590872075ff2240e05ef645131b5c1133e1928b56c0da3fdae3ad85
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.9

Security for motim 0.2.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page