Mock Servers

Stand up a mock API before the backend exists

Run a mock HTTP server on your own machine, backed by the response examples already in your collection, or generated straight from an OpenAPI spec. No cloud to provision, no deploy to wait on.

In beta · Enable under Preferences → Beta → Mock Server
zsh · mock server
$ curl http://localhost:4000/v1/users/42
HTTP/1.1 200 OK · application/json
{
"id": 42,
"name": "Ada Lovelace",
"role": "admin"
}
# served from a saved response example, no backend running
The Bruno mock server dashboard: a running server with its base URL, and the Responses tab listing the mocked routes.
localhost
Runs on your machine, not in someone's cloud
3 sources
Saved examples, an OpenAPI spec, or by hand
In Git
Mocks travel with the collection
Where the responses come from

Use what you already have

A mock is only useful if it stays honest. Bruno builds one out of artefacts you already maintain, so it keeps matching the API it stands in for.

1

Sync with Examples

Every saved example in the linked collection becomes a mock response: method, path, status, headers, and body. Re-sync whenever the examples change.

2

Generate from API Spec

Point the server at a file under API Specs and Bruno turns each OpenAPI operation into a route with a response you can edit.

3

Write them by hand

Run standalone with no linked source and add responses yourself: method, path, status, headers, and body, straight in the Responses tab.

Why it's different

A mock server that behaves like the rest of your repo

Local-first by default

The server binds to http://localhost:<port> on your machine. Nothing is hosted, nothing is shared upstream, and it works with the network off.

Mocks live in the collection

Mock servers are saved as plain .yml files under workspace/mocks/. Clone the repo and you get the same mocks, with no separate service to stand up or share credentials for.

Rules pick the right response

Several responses can share a method and path. Rules on headers, query parameters, or the body decide which one comes back: admin versus guest, valid versus rejected.

Ready for the browser

CORS is on by default and OPTIONS preflights return 204 with the right headers, so a frontend can call the mock without a proxy in front of it.

Matching rules

One route, every scenario

Give a response a target, key, operator, and value, then choose whether all rules must match or any one will do. The happy path, the validation error, and the empty list can all live on the same endpoint.

Match on headers, query parameters, or the request body
Nested body fields by user.type or $.user.type
Path parameters with :param, like /v1/users/:id
All rules AND by default, or switch to any rule OR
The mock response editor with its Rules section: target, key, operator, and value conditions that select this response over others on the same route.
See what happened

A request log that explains its own decisions

The Routes tab lists every registered method and path with its response count and hit count. The Request Log records live traffic, and the Match Trace Inspector shows exactly which rules were evaluated and why one response won.

Time, method, path, status, delay, and duration per request
Filter by match status or status-code family
A global Delay (ms) control for testing slow responses
Unmatched paths return a 404 listing the routes that do exist
The Request Log tab, listing incoming requests with their method, path, matched mock response, status, delay, and duration.
How it works

Four steps to a running mock

1

Turn the beta on

Mock Servers live behind Preferences → Beta → Mock Server while the feature is in beta.

2

Create the server

In the Mock Servers sidebar, click +, name it, and either link a collection or API spec, or leave it standalone.

3

Fill in the responses

Sync with Examples, Generate from API Spec, or add a New Mock Response and write the payload yourself.

4

Start the server

Hit Start Server, copy the base URL, and point your frontend, tests, or teammates at it.

Mock Servers are in beta. Closing Bruno stops every running mock, and restarting Bruno does not start them again. Each server is started deliberately so nothing quietly claims a port. The request log keeps the most recent 500 entries per server, in memory only.

Stop waiting on the backend

Spin up a mock from the examples you've already saved, and get your frontend moving today.

Free and open source · macOS, Windows & Linux · No account needed