mock_endpoint
Set up a mock HTTP endpoint by providing method, path, and response. No OpenAPI spec required.
Instructions
Quickly mock a single HTTP endpoint without writing an OpenAPI spec. Pass method (default GET), path (the EXACT HTTP path the user described, including all segments), and the response body (object → JSON, string → text). The bridge writes the response into a managed static dir at ~/.cache/mockzilla-mcp/mocks/ and (re)starts a single shared mockzilla server pointing at it.
Pass path AS IS. Do NOT prepend or duplicate any segment. The bridge derives the service name from the first segment for internal grouping, but it does not change the URL the user hits. Examples:
• User says GET /pets/{id} → call mock_endpoint with path=/pets/{id} → URL is http://HOST:PORT/pets/{id}
• User says POST /orders → path=/orders → URL is http://HOST:PORT/orders
• User says GET /v1/users/me → path=/v1/users/me → URL is http://HOST:PORT/v1/users/me
Path placeholders like {id} are stored as literal directory names — by default ALL placeholder values share the same response. To return different responses for specific values, call mock_endpoint again with a literal value (e.g. /pets/123).
Calling this multiple times accumulates endpoints in the same server — adding POST /pets after GET /pets/{id} keeps both. Mutually exclusive with serve_locally: stop any ad-hoc server first. See mockzilla_docs_search('static directory') for the underlying convention.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| method | No | GET | |
| path | Yes | Path beginning with /. First segment is the service name. | |
| response | No | Response body. Object → JSON. String → text. Default {}. | |
| status | No | ||
| content_type | No | Override content type. Inferred from response type if omitted (object → application/json, string → text/plain). |