serve_locally
Start a temporary local mock server from OpenAPI specs or public URLs, combining multiple APIs into one server, no account needed. Use for local experimentation before deploying hosted mocks.
Instructions
Start ONE mockzilla portable mock server on this machine that serves any number of APIs together — no mockzilla account needed. Pass input as a single spec path / directory / public https URL, OR an array of them to combine multiple APIs into the same server (each becomes a service mounted at //...). Returns {url, port, pid, services} plus example_endpoints, callable URLs for a single spec. Use one of those rather than guessing a path: each service answers under its mount prefix, not at the spec's bare path. Pair with stop_locally(pid) to clean up. Prefer this over deploy_mock_from_* whenever the user says 'try locally', 'experiment', or 'play with' — those tools create persistent hosted bundles, this one is ephemeral. The bridge only runs ONE local server at a time on purpose: if the user wants more APIs, stop the current server and restart with all of them in input.
To test how a client handles a slow or failing API, pass latency and/or errors. These and mount/context work only when input is a single spec or single-service folder.
If the user names a well-known API (stripe, twilio, github, openai, slack, etc.) WITHOUT providing a URL, recall the public OpenAPI spec URL from your training knowledge and pass that. Do NOT pass a catalog ID or slug from list_catalog_products — that catalog is for the HOSTED deploy_mock_from_catalog flow, its ids are not URLs. Examples of public OpenAPI URLs:
• Stripe: https://raw.githubusercontent.com/stripe/openapi/master/openapi/spec3.json
• Twilio: https://raw.githubusercontent.com/twilio/twilio-oai/main/spec/json/twilio_api_v2010.json
• GitHub: https://raw.githubusercontent.com/github/rest-api-description/main/descriptions/api.github.com/api.github.com.json
• Petstore: https://petstore3.swagger.io/api/v3/openapi.json
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| port | No | Port to bind on. Omit or pass 0 to let the OS pick a free port. | |
| input | Yes | Spec file path(s), directory, or public OpenAPI URL(s). Pass an array to combine multiple APIs into one server. | |
| mount | No | URL path to mount the service at, e.g. "pets/v2". | |
| errors | No | Error injection by cumulative percentile, keys p1 to p100. {"p5": 500, "p10": 503} returns 500 for 5% of requests and 503 for the next 5%. | |
| context | No | Path to a flat context YAML of replacement values for generated data. | |
| latency | No | Delay added to every response, as a Go duration: "100ms", "1.5s". |