Create a Mock Server
You can create a mock server from a collection of saved response examples, from an OpenAPI spec, or as a standalone (manual) mock.
Create from a collection (saved examples)
Use this path when the collection already has saved response examples.
- Open the collection.
- In the sidebar, click the + icon next to Mock Servers and enter a Name of the mock server.
- Select Collection as the source, pick the collection, then click Create.
- Every saved example becomes a mock response (method, path, status, headers, and body).
- Click Start Server to start the mock server on the saved port. If the port is already in use, change it under Mock Server Settings (gear icon) → Advanced settings.

Create from an OpenAPI spec
Use this path when you have an API spec in the workspace. Turn on API Spec under Preferences → Features if it is not already enabled.
- Load the spec under API Specs in the sidebar (if it is not already there).
- In the sidebar, click the + icon next to Mock Servers and enter a Name of the mock server.
- Select API Spec as the source, pick the spec, then click Create.
Each operation and response status becomes a mock response with bodies derived from the schema where possible.

Once the mock server is created, click Start Server to start it on the saved port. If the port is already in use, change it under Mock Server Settings (gear icon) → Advanced settings.
Create a standalone (manual) mock
To add responses yourself instead of syncing from a collection or spec:
- In the sidebar, click the + icon next to Mock Servers.
- Enter a Name of the mock server.
- Select Standalone as the source.
- Optionally set Port and Response delay under Advanced settings.
- Click Create, then add responses from the Responses tab.

Where Bruno store mock servers
Mock servers are stored in the workspace at the root of the mocks folder. After creation, the mock server is saved as a .yml file.
workspace
└── mocks
└── <mock-server-one.yml>
└── <mock-server-two.yml>
└── ...
mock:
port: 4000
source:
type: collection
path:
routes:
- name: echo-example (mock) #mock response name
description: Echo endpoint with sample json body
request:
method: POST
url: /
body:
type: json
data: |-
{
"title":"usebruno",
"msg":"The most loving API client for Developers"
}
response:
status: 200
statusText: OK
headers:
- name: bearer
value: secret123
body:
type: json
data: '{"title":"usebruno"}'
rules: #optional rules to match the request
operator: AND
conditions:
- target: body
key: title
operator: equals
value: usebruno
copiedFrom:
example: echo-example
requestPath:
`}
Next steps
- Run a mock server — start, stop, and manage mock servers from the dashboard