Skip to content

Choose what the assistant may do

Two layers decide what an assistant does in MockHub:

  • The role decides what is possible: the role you chose when you signed the assistant in, or its token’s role. MockHub enforces it and nothing can get around it: an assistant with the Viewer role cannot change anything, whatever it tries.
  • The assistant’s settings decide what happens without asking you first. Use them to let harmless lookups run on their own and keep a confirmation on everything that changes data.

A personal token has the lower of your current role in the workspace and the token’s role; a machine token has the role it was created with. An assistant you signed in through the browser acts like a personal token: it has the lower of your current role and the role you chose on MockHub’s Connect an AI assistant page, Editor unless you changed it, never above your own. Signing it in again is the way to change that role.

Through MCP, the assistant can… Viewer Editor Admin Owner
See projects, mocks and request logs ✓ ✓ ✓ ✓
Create, change and delete mocks ✓ ✓ ✓
Turn a logged request into a mock ✓ ✓ ✓
Rename a project, change its description or subdomain ✓ ✓ ✓
Create a project (personal token only) ✓ ✓ ✓
Delete a project ✓ ✓
See verification runs and their reports ✓ ✓ ✓ ✓
Cancel a verification run ✓ ✓ ✓

A Viewer can also see a project’s data store and its records; clearing them takes an Editor.

With a personal token, or signed in through the browser, the assistant can also set up and drive a running test, undo a change to a mock, and draft changes for you:

Through MCP, with a personal token, the assistant can… Viewer Editor Admin Owner
See scenarios, chaos profiles, webhooks and their deliveries ✓ ✓ ✓ ✓
See a mock’s earlier versions ✓ ✓ ✓ ✓
See the AI assistant proposals it drafted for you ✓ ✓ ✓ ✓
Create, rename and delete a scenario, or change its states ✓ ✓ ✓
Set or reset a scenario’s state, start or stop a chaos profile ✓ ✓ ✓
Create a chaos profile ✓ ✓
Restore an earlier version of a mock ✓ ✓ ✓
Send a webhook ✓ ✓ ✓
Draft changes with MockHub’s AI assistant, for you to apply ✓ ✓ ✓
Preview an OpenAPI import (a machine token can too) ✓ ✓ ✓

A machine token cannot use these tools, whatever its role, apart from the import preview. Changing or deleting a chaos profile, and creating or changing a webhook, are done in the dashboard; the one exception is a whole configuration document applied by an Admin, which is also the way to change a webhook’s schedule. Applying a draft or an import is done in the dashboard too: no token can apply either.

On top of the role:

  • A machine token restricted to one project sees and changes only that project.
  • The workspace’s plan limits still apply, and the assistant is told when it reaches one.
  • While a workspace is suspended for a billing problem, reading works and changes are refused.

For the least access that does the job, give an assistant that only looks the Viewer role, and use a machine token restricted to one project for focused work. Settings files are easy to change; the role is not.

The connection URL chooses which toolsets the assistant sees listed. A tool outside them still works when the assistant calls it by name, and a tool in them is still refused when the role does not allow it. Choose toolsets to keep the list short, and the role to limit what the assistant can do. The server also leaves out of the list the tools the role or token kind can never use.

An assistant you signed in through the browser stays connected until you disconnect it:

  1. Open Settings → Profile.
  2. Under Connected AI assistants, select Disconnect beside the assistant, and confirm.

It loses access at once, and to connect it again you sign in again. Leaving the workspace disconnects your assistants there too, and rejoining does not reconnect them.

An Admin sees every member’s connected assistants under Settings → Tokens, under Connected AI assistants, and can disconnect any of them. For a token, revoke the token instead; see Stay safe with an AI assistant.

Each MCP tool has a name, listed in MCP tools. Assistants let you allow, confirm or remove tools one by one.

Claude Code asks before every MCP tool call until you allow it. A tool’s permission name is mcp__, the name you gave the server, __, and the tool name: mcp__mockhub__list_projects. mcp__mockhub on its own matches every MockHub tool.

Put rules in ~/.claude/settings.json (you, in every folder), .claude/settings.json in a repository (everyone working in it) or .claude/settings.local.json (you, in that repository only), or manage them with /permissions. When rules overlap, deny beats ask, and ask beats allow.

The recommended setup lets lookups run freely, asks before changes, and removes project deletion:

{
"permissions": {
"allow": [
"mcp__mockhub__whoami",
"mcp__mockhub__list_projects",
"mcp__mockhub__get_project",
"mcp__mockhub__list_mocks",
"mcp__mockhub__get_mock",
"mcp__mockhub__list_request_logs",
"mcp__mockhub__get_request_log",
"mcp__mockhub__get_request_log_body"
],
"ask": [
"mcp__mockhub__create_project",
"mcp__mockhub__update_project",
"mcp__mockhub__create_mock",
"mcp__mockhub__update_mock",
"mcp__mockhub__set_mocks_status",
"mcp__mockhub__delete_mock",
"mcp__mockhub__delete_mocks",
"mcp__mockhub__delete_mock_request_logs",
"mcp__mockhub__create_mock_from_request_log"
],
"deny": ["mcp__mockhub__delete_project"]
}
}

The data store tools fit the same split: add mcp__mockhub__get_store, mcp__mockhub__list_store_records and mcp__mockhub__get_store_record to allow, and mcp__mockhub__put_store_records and mcp__mockhub__clear_store to ask.

So do the project settings, which need a personal token: add mcp__mockhub__get_project_settings to allow and mcp__mockhub__update_project_settings to ask, since a change applies to the project’s address at once.

Checking request logs against the OpenAPI contract keeps each verdict as the log’s latest check, which coverage shows, and changes nothing your mocks answer: add mcp__mockhub__check_request_log_contract, mcp__mockhub__check_request_logs_contract and mcp__mockhub__get_openapi_coverage to allow.

mcp__mockhub__preview_request belongs in allow too: it tries a request against your mocks in the sandbox and changes nothing.

Add the lookups mcp__mockhub__list_scenarios, mcp__mockhub__list_chaos_profiles, mcp__mockhub__list_webhooks, mcp__mockhub__list_webhook_deliveries, mcp__mockhub__list_assistant_proposals, mcp__mockhub__list_mock_versions and mcp__mockhub__get_mock_version to allow. Put mcp__mockhub__create_scenario, mcp__mockhub__update_scenario, mcp__mockhub__delete_scenario, mcp__mockhub__set_scenario_state, mcp__mockhub__reset_scenario, mcp__mockhub__reset_scenarios, mcp__mockhub__create_chaos_profile, mcp__mockhub__start_chaos_profile, mcp__mockhub__stop_chaos_profile, mcp__mockhub__restore_mock_version and mcp__mockhub__fire_webhook in ask: they change the project’s definitions or what it answers, or send a request, at once. Keep mcp__mockhub__propose_changes and mcp__mockhub__preview_openapi_import in ask too, since each uses an allowance.

To trust MockHub completely, for a Viewer token or one restricted to a throwaway project, allow mcp__mockhub.

Codex uses the plain tool names, set in ~/.codex/config.toml:

[mcp_servers.mockhub]
url = "https://api.mockhub.io/_mcp/all"
bearer_token_env_var = "MOCKHUB_MCP_TOKEN"
# Lookups run freely; anything that changes data asks first.
default_tools_approval_mode = "writes"
# Remove project deletion from this assistant entirely.
disabled_tools = ["delete_project"]

default_tools_approval_mode accepts "auto", "prompt" (ask every time), "writes" or "approve", and can be set for a single tool:

[mcp_servers.mockhub.tools.update_project]
approval_mode = "prompt"

For an assistant that only reads, list the lookup tools:

enabled_tools = ["whoami", "list_projects", "get_project", "list_mocks", "get_mock", "list_request_logs", "get_request_log", "get_request_log_body"]

Add "get_store", "list_store_records" and "get_store_record" to that list to let it read the data store too, and "get_project_settings" for the project settings.

Add "check_request_log_contract", "check_request_logs_contract" and "get_openapi_coverage" to let it check request logs against the contract and read its coverage. A check keeps its verdict, so the two checks are not marked read-only, and under "writes" Codex asks before each one.

Add "list_scenarios", "list_chaos_profiles", "list_webhooks", "list_webhook_deliveries", "list_assistant_proposals", "list_mock_versions" and "get_mock_version" to let it see those too. Give propose_changes a longer tool_timeout_sec, such as 180: a draft can take a couple of minutes.

  • A role is the narrowest grant; there is no “may create mocks but not delete them”. Combine a role, a project restriction and the assistant’s own settings.
  • An assistant signed in through the browser cannot be restricted to one project; use a machine token for that.

Report a problem with this page