Docs menu · MCP server
APIMock documentation
MCP server
APIMock runs a remote Model Context Protocol server, so a coding agent can create mock endpoints and resources, read your workspace's contract, debug failed requests and break the mock on purpose, all from the chat. Nothing to install: it's one URL, and you either sign in or paste a token.
Updated
Connect
The server speaks Streamable HTTP at https://app.apimock.dev/api/mcp. In claude.ai, Claude Desktop or Claude mobile, add it as a custom connector with that URL and sign in to APIMock when asked. In Claude Code, add the URL, then run /mcp to sign in:
claude mcp add --transport http apimock https://app.apimock.dev/api/mcpSigning in connects the app to your account; manage connected apps under Settings → Connected apps. Clients that can't sign in, such as Cursor, take an API token in a header instead (see below):
claude mcp add --transport http apimock https://app.apimock.dev/api/mcp \
--header "Authorization: Bearer am_pat_your_token_here"Other clients that read an mcpServers file take the same URL and header. Clients without remote HTTP support can use npx mcp-remote as a bridge; the Claude Desktop guide walks through it.
{
"mcpServers": {
"apimock": {
"type": "http",
"url": "https://app.apimock.dev/api/mcp",
"headers": {
"Authorization": "Bearer am_pat_your_token_here"
}
}
}
}Tokens and scopes
- Create a personal access token under Settings → API Tokens. It starts with
am_pat_and is shown once. - A
readtoken can list, get and inspect. Creating, changing or deleting anything needswrite, which includes read. When you sign in from an app, untick "Create, change and delete" to connect it read-only. - Tokens expire after 90 days by default (30 days, a year or never are also offered) and can be revoked at any time.
- A token acts as you in every workspace you belong to. Each tool call names its target with a
workspaceslug fromlist_workspaces.
Tools
| Workspaces and folders | Scope | What it does |
|---|---|---|
| list_workspaces | read | Your workspaces, with the slug every other tool takes. |
| list_folders | read | Folders and subfolders, with ids and paths. |
| create_folder | write | Create a folder or subfolder. |
| delete_folder | write | Delete a folder, its subfolders and their endpoints. Refuses folders holding resources. |
| Endpoints | Scope | What it does |
|---|---|---|
| list_endpoints | read | Every endpoint's method, route and status. |
| get_endpoint | read | One endpoint's full configuration, response variants and live URL. |
| create_endpoint | write | Create a static or templated mock response, optionally with response variants. |
| update_endpoint | write | Change any setting, including response variants; only the fields you pass change. |
| simulate_request | read | Which endpoint and response variant a request would get, and why, without sending it. |
| delete_endpoint | write | Delete one endpoint. |
| import_openapi | write | Import an OpenAPI or Swagger spec from text or a URL. |
| Resources | Scope | What it does |
|---|---|---|
| scaffold_backend | write | Create several resources with seed records, plus custom endpoints, in one call. |
| create_resource | write | Create one stateful CRUD collection. |
| list_resources | read | Resources with their URL, fields and record count. |
| delete_resource | write | Delete a resource with its records and CRUD routes. Other routes in its folder stay. |
| Debugging and faults | Scope | What it does |
|---|---|---|
| inspect_failed_requests | read | Recent 4xx, 5xx and unmatched requests, with headers, bodies and match diagnostics. |
| heal_mock_endpoint | write | Fix an endpoint's body, status or request schema after a failure. |
| set_fault_rule | write | Inject errors, latency or broken payloads for a while. |
| list_fault_rules | read | Active fault rules and the minutes they have left. |
| clear_fault_rules | write | Remove one fault rule, or all of them. |
Tools are annotated as read-only or destructive, so clients can run reads without asking and confirm before a change. A resource's generated CRUD routes can't be edited or deleted one by one; use delete_resource for those.
Resources and prompts
Each workspace's contract is available as an MCP resource, so the agent can read the exact shapes it should code against: apimock://workspaces/{slug}/openapi.json (OpenAPI 3.1) and apimock://workspaces/{slug}/types.d.ts (TypeScript). They match the /openapi.json and /types.d.ts files served on the workspace's mock domain.
The server also ships prompts, which Claude Code lists as slash commands:
mock_backend_for_frontend: Reads your frontend code, models its data and scaffolds CRUD mocks with seed records.debug_failing_requests: Groups recent failures, decides whether the mock or the client is wrong, and fixes the mock.test_error_states: Injects a 503, a 429, latency and null fields one at a time and reviews how your code copes.
Limits
- 120 MCP requests per minute per user.
import_openapi,scaffold_backendandcreate_resourceshare a tighter budget: 10 calls a minute and 60 an hour.- Everything the agent creates counts toward the same workspace quotas as the dashboard, and shows up there straight away.
Connect your agent
Create a token, paste the config, and ask your agent to list your workspaces.
Create a token