You want your coding agent to look something up in a web app. The app has a search box and an orders page, but no public API you can hand to the agent.
You could ask the agent to open a browser and click through the UI every time. Yet when you use the app yourself, its frontend is already making requests for that data.
I built site2api to turn those requests into a local Model Context Protocol (MCP) server. You use the app, site2api records the traffic, identifies operations and inputs, verifies read operations against the live site, and generates tools an agent can call.
What the workflow looks like
With Node.js 22.12+ and Chrome installed, start with:
npx site2api run https://app.example.com
A dedicated browser profile opens. Sign in if the app requires it, then use the features you want to expose: search for two different terms, open two different orders, or try another operation twice with different inputs. That variation helps site2api distinguish an input from a constant in the request.
Press Enter in the terminal when you're done. The command analyzes the recording, checks eligible read operations against the live app, and writes a server to out/mcp/.
out/
├── report.md # Detected operations and input relationships
├── verify.json # Results of the live read checks
└── mcp/
├── server.mjs # Local MCP server
├── tools.json # Generated tool definitions
└── mcp.json # Client configuration
You can also import an existing HAR from your browser's DevTools with site2api from-har capture.har -o out.
Why I added a verification step
A captured request is evidence that something worked during recording. It does not mean an inferred tool will still work with the current session and current response shape.
site2api's verifier calls eligible read operations and compares the live responses with the recorded schemas. It reports a pass, a warning for missing fields, a failure for an unexpected response or schema mismatch, an error for issues such as expired credentials or redirects, or a skip when a required input or credential is unavailable.
That distinction matters when an agent is about to rely on a generated tool. A skipped tool needs more input; an authentication error needs a fresh session; a schema failure may mean the site changed. The generated server can be limited to passing and warning read tools with --only-verified. Verification never calls login or write operations.
Connect the generated server
The output includes an MCP configuration and setup guide. For example, to register it with Claude Code:
claude mcp add app -e SITE2API_COOKIE='<Cookie header>' -- node /absolute/path/to/out/mcp/server.mjs
The generated guide tells you which environment variables your server needs. Your agent can then use the discovered tools to answer questions about the app's data.
The tool definitions also describe relationships between operations. For example, if a list response contains an order ID used by a detail request, the agent has a path from listing orders to opening one. What it can do depends on the traffic you recorded and the results of verification.
Boundaries that matter
The raw HAR can contain session credentials. Keep it private and out of your repository. Generated files are checked for captured credential values, while the server takes the credentials it needs from its environment at runtime. Optional LLM-assisted naming sends operation names and shapes, not recorded values; a separate LLM API key is not required for the basic run workflow.
Write tools are excluded by default. If you explicitly enable them, every call still requires confirm: true. The verifier does not execute writes.
site2api is a fit for web apps that make JSON or GraphQL requests, including your own internal tools and accounts you are authorized to use. It will not turn an HTML-only site into a useful API, bypass a CAPTCHA, or make an unstable private endpoint stable. Use it within the site's terms.
Try it
The project is MIT-licensed on GitHub, with a getting-started guide and a local demo shop you can use before recording a real app. If you find it useful, please star the GitHub repository so more developers can discover it. I'd also love to hear which kinds of web apps produce useful tools and where the generated inputs need work.













