How do I turn a HAR file into an MCP server?
Export a HAR from your browser while using the app, then run web2mcp quick site.har. It picks the API origin, builds a read-only-safe profile, and prints a paste-ready MCP config. web2mcp serve <profile> then runs the server over stdio. No browser is needed at call time.
Export a HAR
- Chrome / Edge: DevTools (F12) → Network → right-click a request → Save all as HAR with content.
- Firefox: DevTools → Network → gear ⚙ → Save All As HAR.
- Safari: enable the Develop menu → Show Web Inspector → Network → Export.
The HAR carries your login cookies, so your session travels with it. Keep it out of version control.
Build and run
web2mcp inspect site.har # see origins, read/write split, login
web2mcp quick site.har # auto-pick origin → read-only-safe profile + config
web2mcp serve site-profile # run the MCP server over stdio
Want the explicit form, or to pin the origin yourself:
web2mcp discover site.har --out site-profile --origin https://api.example.com --read-only-safe
Phone and desktop apps
If you can capture an app's traffic, you can integrate it the same way. Route a phone app or an Electron desktop app through mitmproxy with its CA certificate trusted, export a HAR (File → Export → HAR, or mitmdump --save-har out.har), and use it like any other HAR.
Limits
Only capture apps and accounts you are authorized to automate. HTTP method alone is not enough to tell reads from writes, so side-effect paths (logout, export, approve…) are never auto-classified as reads. Writes stay hidden until you install a reviewed contract. Non-JSON, streaming and WebSocket interfaces are not auto-promoted.