Start or stop a local mock API
mock_serverStarts a mock API from an OpenAPI spec or saved examples to test clients before the real API exists, and stops or lists running mocks for isolated tests.
Instructions
Starts a mock API on 127.0.0.1 from an OpenAPI spec (path, URL or text) or from a collection's saved examples, and returns its base URL; stops one (id) or all; or lists the running ones. Use it to test a client before the real API exists, or to isolate a test. Mocks live as long as this MCP server.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"action": "<action>"
},
"name": "mock_server"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | No | stop: which mock (default all) | |
| url | No | OpenAPI URL | |
| path | No | OpenAPI file | |
| port | No | Default: a free port | |
| text | No | OpenAPI JSON/YAML text | |
| action | Yes | ||
| folder | No | ||
| collection | No | Mock a collection's saved examples instead |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mocks | Yes | ||
| stopped | Yes |