MCP tools
The MCP server is at https://api.mockhub.io/_mcp. To connect to it, see Connect an AI assistant.
Toolsets
Section titled “Toolsets”The tools come in toolsets, and the connection URL chooses which toolsets the server lists:
| URL | Lists |
|---|---|
https://api.mockhub.io/_mcp |
The default toolsets: core, mocks, traffic and state |
https://api.mockhub.io/_mcp/all |
Every toolset |
https://api.mockhub.io/_mcp/default+contracts |
The default toolsets and contracts |
https://api.mockhub.io/_mcp/contracts+webhooks |
contracts and webhooks only, without core |
Join names with +, in any order. Only the names in the URL are listed: a URL with neither default, all nor core leaves out whoami, the project tools and the docs tools, so name core too. An unknown name is refused with mcp-toolset-unknown.
A toolset decides what the assistant sees, not what it may do. A tool outside the connection’s toolsets still works when called; the token’s role and kind decide what is allowed. Fewer tools keep the assistant’s context small, which matters for a client that loads every tool definition up front. whoami names the toolsets the connection lists and, for each other one, its tools and the URL that adds it.
A client that signed in through the browser is connected to the URL it signed in with: to change toolsets, remove MockHub from the client, add it again with the new URL, and sign in again. A token works at every URL.
The Claude Code permission name of each tool is mcp__mockhub__ followed by the tool name, when the server is named mockhub.
Core (core)
Who the token is, the projects it reaches, creating a project, searching and reading the docs. In the default toolsets, at https://api.mockhub.io/_mcp.
| Tool | What it does | Changes data | Least role |
|---|---|---|---|
get_tool_definition | Shows the arguments and availability of a named tool, and how to reconnect if it is outside the listed toolsets | No | Viewer |
whoami | Shows the token, its workspace, its role, any project restriction, and the tools it cannot use and why | No | Any |
list_projects | Lists the workspace's projects, optionally filtered by name, each with its address and how many of its mocks are active | No | Viewer |
get_project | Shows one project's details | No | Viewer |
search_docs | Searches these docs and answers the five best pages, with the headings that match | No | Any |
read_docs | Reads one page of these docs, or one section of it, as markdown | No | Any |
create_project | Creates a project on a new subdomain | Yes | Editor, personal token only |
Mocks (mocks)
Read, create, change, tag, delete and restore mocks. In the default toolsets, at https://api.mockhub.io/_mcp.
| Tool | What it does | Changes data | Least role |
|---|---|---|---|
get_mock_response | Reads one saved response with version-checked body chunks for large definitions | No | Viewer |
list_mocks | Lists a project's mocks with how many responses each holds and which is the default, the other mocks that answer the same requests, and when each was last called, optionally by status, HTTP method, tag, or how long nobody has called them | No | Viewer |
get_mock | Shows one mock's full definition and the project's other mocks that answer the same requests | No | Viewer |
list_mock_tags | Lists the tags a project's mocks carry, with how many carry each | No | Viewer |
tag_mocks | Adds tags to, or removes them from, up to 100 mocks | Yes | Editor |
create_mock | Creates a mock with one or more named responses and which of them answers, by default, by rules on the request or in a sequence, optionally in a scenario, without templating or linked to an OpenAPI operation | Yes | Editor |
update_mock | Changes any part of a mock: its name, request, responses, which response answers, status, data store use, scenario, templating or OpenAPI operation; refuses to overwrite a change someone made since you read it | Yes, overwrites | Editor |
set_mocks_status | Turns up to 100 mocks on or off in one call, all or none within your plan | Yes | Editor |
list_mock_versions | Lists a mock's earlier versions, newest first: what each change was, who made it and when, and what restoring each would change | No | Viewer, personal token only |
get_mock_version | Shows one earlier version of a mock in full, and how it differs from the mock now or from another version | No | Viewer, personal token only |
restore_mock_version | Puts a mock back as it was in an earlier version; the mock it replaces is kept as a version, so a restore can be undone | Yes, overwrites | Editor, personal token only |
delete_mock | Deletes a mock | Yes, permanently | Editor |
delete_mocks | Deletes up to 100 mocks in one call, all or none | Yes, permanently | Editor |
scaffold_resource | Previews, then creates, the inactive mocks that make a path a REST resource over one data store collection, tagged resource:<name>, and seeds an empty collection from examples | Yes | Editor |
preview_identity_provider | Shows the identity-provider endpoints a preset would create as mocks, without creating them | No | Editor |
install_identity_provider | Creates the identity-provider endpoints exactly as their preview showed, as inactive mocks | Yes | Editor |
Traffic (traffic)
Request logs, why a request matched, a mock from a logged request. In the default toolsets, at https://api.mockhub.io/_mcp.
| Tool | What it does | Changes data | Least role |
|---|---|---|---|
delete_mock_request_logs | Clears every logged request one mock answered; the mock stays | Yes, permanently | Editor |
list_request_logs | Lists requests a project received, by mock, method, origin, time or whether a mock matched, with which response answered and why a mock could not render | No | Viewer |
get_request_log | Shows one logged request in full: its headers and body and the response's, as far as the project's logging kept them | No | Viewer |
get_request_log_body | Reads a logged request or response body in chunks when it is too large for the full log | No | Viewer |
create_mock_from_request_log | Turns a logged request into a new mock | Yes | Editor |
explain_request_log_match | Says why a logged request matched no mock, by replaying it against the closest mocks; makes up to six sandbox requests, which spend no request allowance | No | Viewer |
preview_request | Answers a request you describe with the project's mocks as saved, without serving or logging it: the closest three mocks, or one you name, each tried in the sandbox, which spends no request allowance | No | Viewer, personal token only |
State (state)
Scenarios, the data store and fixtures. In the default toolsets, at https://api.mockhub.io/_mcp.
| Tool | What it does | Changes data | Least role |
|---|---|---|---|
get_store | Shows a project's data store: each collection's records and size, which mocks save to it, and the limits | No | Viewer |
list_store_records | Lists one data store collection's records with their versions, searched, filtered and sorted as its list endpoint would | No | Viewer |
get_store_record | Reads one data store record whole, with the version an update sends back | No | Viewer |
put_store_records | Adds or updates up to 100 records in one collection, all or nothing; an update is refused when the record changed since it was read | Yes, overwrites | Editor |
clear_store | Deletes the records of one collection or of the whole data store; mocks stay | Yes, permanently | Editor |
list_scenarios | Lists a project's scenarios with their states and the state each is in now | No | Viewer, personal token only |
create_scenario | Creates a scenario with its states, for mocks to join | Yes | Editor, personal token only |
update_scenario | Renames a scenario or replaces its states; refuses to remove a state a mock still uses | Yes, overwrites | Editor, personal token only |
delete_scenario | Deletes a scenario that no mock is attached to | Yes, permanently | Editor, personal token only |
set_scenario_state | Moves a scenario to one of its states; the next request sees it | Yes, overwrites | Editor, personal token only |
reset_scenario | Puts a scenario back in its first state; the next request sees it | Yes, overwrites | Editor, personal token only |
reset_scenarios | Puts every scenario and response sequence in a project back to its start, as the dashboard's Reset all does; the next request sees it | Yes, overwrites | Editor |
list_fixtures | Lists a project's saved fixtures without their records | No | Viewer |
get_fixture | Shows one saved fixture's records and scenario states | No | Viewer |
apply_fixture | Resets a project's data store and scenarios to a saved fixture; mocks stay | Yes, overwrites | Editor |
Contracts (contracts)
OpenAPI contract checks, coverage and import. Added to the default toolsets by https://api.mockhub.io/_mcp/default+contracts.
| Tool | What it does | Changes data | Least role |
|---|---|---|---|
check_request_log_contract | Checks a logged response against one revision of the project's OpenAPI contract, as far as the log kept it as sent, and keeps the verdict as the log's latest check | Yes | Viewer |
check_request_logs_contract | Checks up to 20 logged responses a call against one or two contract revisions, says how each verdict moves between them, and keeps each as the log's latest check | Yes | Viewer |
check_openapi_requests | Checks up to 500 requests you supply against one revision of the project's OpenAPI contract before you send them, naming each broken rule and never a value | No | Viewer |
get_contract_health | Shows whether background contract checks run for a project and, for a period, what their sample found per operation; needs a personal token | No | Viewer |
get_openapi_coverage | Shows, for each operation of one contract revision, the mocks that serve it now and the latest checks of logged responses against it | No | Viewer |
preview_openapi_import | Shows what importing an OpenAPI document would change, without importing it; counts as one import | No | Editor |
apply_openapi_import | Imports an OpenAPI document exactly as a preview planned it; new mocks start inactive unless asked to activate them. Counts as one import | Yes, overwrites | Editor |
Chaos (chaos)
Start and stop chaos profiles. Added to the default toolsets by https://api.mockhub.io/_mcp/default+chaos.
| Tool | What it does | Changes data | Least role |
|---|---|---|---|
list_chaos_profiles | Lists a project's chaos profiles, which one is running and until when | No | Viewer, personal token only |
create_chaos_profile | Saves a chaos profile with a delay, an injected error or a broken connection, switched off until started | Yes | Admin, personal token only |
start_chaos_profile | Turns a chaos profile on for up to a day, turning off any other; calling it again restarts the countdown | Yes, overwrites | Editor, personal token only |
stop_chaos_profile | Turns a chaos profile off | Yes | Editor, personal token only |
Webhooks (webhooks)
List and fire webhooks, read deliveries. Added to the default toolsets by https://api.mockhub.io/_mcp/default+webhooks.
| Tool | What it does | Changes data | Least role |
|---|---|---|---|
list_webhooks | Lists a project's webhooks, without their secrets or header values | No | Viewer, personal token only |
fire_webhook | Sends a webhook once; every call sends again and counts against the webhook allowance | Yes | Editor, personal token only |
list_webhook_deliveries | Lists a webhook's deliveries and how each went, without sending anything | No | Viewer, personal token only |
Config as code (config)
The project config document and packs. Added to the default toolsets by https://api.mockhub.io/_mcp/default+config.
| Tool | What it does | Changes data | Least role |
|---|---|---|---|
get_project_config | Exports a project's mocks, scenarios, chaos profiles, webhooks, settings and contract as one configuration document | No | Viewer |
preview_project_config | Shows what applying a configuration document would create, change and delete, without applying it | No | Editor |
apply_project_config | Makes a project match a configuration document exactly as its preview showed, deleting what the document leaves out | Yes, overwrites | Editor; Admin to change settings, chaos profiles or webhooks |
list_packs | Lists the packs a project can install: the starter packs, and the workspace's own for a personal token | No | Viewer |
preview_pack | Shows what installing a pack would change, without installing it | No | Editor |
install_pack | Installs a pack exactly as its preview showed, replacing the project's definitions, then resets its data to the pack's fixture | Yes, overwrites | Editor; Admin when the pack changes settings, chaos profiles or webhooks |
delete_pack | Deletes one saved version of a workspace pack; projects that installed it keep their configuration | Yes, permanently | Editor, personal token only |
CI (ci)
Ephemeral environments and verification runs. Added to the default toolsets by https://api.mockhub.io/_mcp/default+ci. The environment permission is Can create, list and delete ephemeral environments on a machine token.
| Tool | What it does | Changes data | Least role |
|---|---|---|---|
create_environment_from_project | Creates a new automatically expiring copy of a project without overwriting an existing environment | Yes | Editor; Admin for settings, chaos or webhooks; machine tokens need the environment permission |
list_environments | Lists the workspace's ephemeral environments with their address and when each is deleted | No | Editor; a machine token also needs the environment permission |
upsert_environment | Creates an empty ephemeral environment that deletes itself after a few hours, or renews the one with that name | Yes | Editor; a machine token also needs the environment permission |
delete_environment | Deletes an ephemeral environment and everything in it; never a permanent project | Yes, permanently | Editor; a machine token also needs the environment permission |
list_verification_runs | Lists the newest application verification runs of this token, or of the workspace for an Admin or Owner, with their state and verdict | No | Viewer; a machine token needs the environment permission |
get_verification_report | Reads a finished run's report as a summary: the verdict, each assertion with its evidence, and the number of calls the dependency received | No | Viewer; a machine token needs the environment permission |
get_request_probe | Reads what a probe of your mocks showed: for each changed request, whether a mock answered it with a success, the copy refused it, or the result could not be decided | No | Viewer; a machine token needs the environment permission |
cancel_verification_run | Stops a verification run that is still going and deletes its preview environments | Yes, permanently | Editor; a machine token also needs the environment permission |
Project settings (projects)
Rename, configure or delete a project. Added to the default toolsets by https://api.mockhub.io/_mcp/default+projects.
| Tool | What it does | Changes data | Least role |
|---|---|---|---|
update_project | Renames a project or changes its description or subdomain | Yes, overwrites | Editor |
delete_project | Deletes a project and everything in it, which only support can recover, for 14 days; needs the project's exact name | Yes, permanently | Admin |
get_project_settings | Shows a project's settings: response templating, what request logs keep, the gateway mode and CORS | No | Viewer, personal token only |
update_project_settings | Changes some of a project's settings, keeping the rest; they apply to the project's address at once | Yes, overwrites | Admin, personal token only |
Assistant (assistant)
Draft changes for review in the dashboard. Added to the default toolsets by https://api.mockhub.io/_mcp/default+assistant.
| Tool | What it does | Changes data | Least role |
|---|---|---|---|
propose_changes | Asks MockHub's AI assistant for a proposal you review and apply in the dashboard; spends one AI credit | Yes | Editor, personal token only |
list_assistant_proposals | Lists your own assistant proposals in a project, newest first, with a link to review each | No | Viewer, personal token only |
A whoami answer looks like this. For a machine token, kind is machine and user is null; projectRestriction names the project a restricted token reaches. For an assistant that signed in through the browser, kind is oauth, client is the name it signed in with, and its token lasts an hour, which the assistant renews on its own.
{ "token": { "name": "Claude Code - work laptop", "kind": "personal", "client": null, "prefix": "mh_sk_3f9a1c", "expiresAt": "2026-12-13T09:30:00+00:00" }, "user": { "email": "ada@example.com", "displayName": "Ada Lovelace" }, "workspace": { "id": "0199a3c2-7a41-7d2e-9b0f-3c5e8d1a2b4f", "name": "Acme" }, "role": "editor", "projectRestriction": null, "toolsets": { "connected": [{ "name": "core", "title": "Core", "tools": ["whoami", "list_projects", "…"] }], "available": [ { "name": "contracts", "title": "Contracts", "summary": "OpenAPI contract checks, coverage and import.", "tools": ["check_request_log_contract", "…"], "url": "https://api.mockhub.io/_mcp/default+contracts" } ] }}token.role is the token’s own role. For a personal token, role is the one it acts with: the lower of its owner’s role and token.role.
The answer also has refusedTools: the tools this token cannot use in its workspace, grouped under the reason a call would be refused with. Every tool it does not list is available. For a machine token with the Editor role, the list starts:
"refusedTools": [ { "reason": "These tools need a personal API token (mh_sk_); machine tokens cannot use them.", "tools": ["list_scenarios", "set_scenario_state", "reset_scenario", "list_chaos_profiles", "start_chaos_profile", "stop_chaos_profile", "list_webhooks", "fire_webhook", "list_webhook_deliveries", "propose_changes", "list_assistant_proposals", "get_project_settings", "update_project_settings", "create_scenario", "update_scenario", "list_mock_versions", "get_mock_version", "restore_mock_version", "delete_scenario"] }, { "reason": "Machine tokens cannot do this. Use a personal API token of a workspace editor or higher.", "tools": ["create_project"] }]get_project answers with capabilities for that project: edit, manage and delete. MCP workflows puts the tools together into tasks.
Rate limit
Section titled “Rate limit”Each token can make 60 requests a minute, counting the few an assistant makes when it connects; for an assistant that signed in through the browser, the limit is per connection. A batch of several requests in one message counts each of them, and a batch of more than 60 is refused. Further requests are answered with 429 until the minute is over.
Identity-provider previews and installs also count toward the workspace’s shared allowance for mock imports. Calls from the app, the CLI and MCP all spend that allowance. If the workspace reaches the limit, the tool returns a retryable 429 with the number of seconds to wait.
Errors the assistant may report
Section titled “Errors the assistant may report”| Message | Meaning |
|---|---|
| Project “…” not found in this token’s workspace | The project is in another workspace, or a restricted machine token cannot see it. |
| Permission denied: this needs the editor role or higher… | The token’s role is too low for the tool. |
| Machine tokens cannot do this. Use a personal API token… | Only people can create projects. |
| This token’s owner is no longer a member of workspace “…” | The person who created the personal token left the workspace. |
| Validation failed. followed by field names | A value was invalid, such as a subdomain that is too short. The assistant usually corrects it. |
| A project with this host already exists | The subdomain is taken. |
| A message about the plan’s limit | The workspace is at a plan limit. |
| Nothing to update | The request did not say what to change. |
This token is limited to the viewer role… means your role allows the tool but the personal token’s role does not: create a token with a higher role, up to your own.
Each refusal also carries the problem MockHub’s API answers, as problem in the tool result’s structured content and as a second block of text: its error type, its HTTP status, the invalid fields, and retryable, which is true only when the same call can succeed after a wait (retryAfter seconds, when given). When a tool refuses says what to do with each.