MCP Mock Scenarios
Use MCP mock responses to return predictable results from a server’s tools, resources, and prompts without running a real backend. Every server exposes a live JSON-RPC endpoint, so a mocked server behaves like the real thing when you test it or share it with an agent.
Mocking lives in the MCP Mocking Service tab on the server detail page, mirroring the A2A Mocking Service tab on Agent Cards. The MCP Spec tab stays focused on the definitions (schemas, URIs, arguments); the mock responses are configured in MCP Mocking Service.
Open the MCP Mocking Service
- Open an MCP server.
- Select MCP Mocking Service.
- Choose Tools, Resources, or Prompts — each tab shows a count of how many of that type the server defines.
- Select the individual tool, resource, or prompt you want to mock. Each one has its own tab, so you configure a single component at a time.
The tab also shows the server’s mock endpoint URL with a copy button, so you can point a client at the running mock.
If a type has no components yet, its tab shows an empty state. Add tools, resources, or prompts from the MCP Spec tab first, then return here to configure their mock responses.
Tool scenarios
A tool can define multiple scenarios. Scenarios are evaluated in order and the first matching condition wins, so put your most specific scenarios first and a catch-all default last.
For each scenario you can set:
- Name — a label for the scenario.
- Condition — a field path, an operator, and a value that are matched against the tool’s input. Leave the condition empty to make the scenario a default that always matches. Supported operators are
equals,not equals,greater than,less than,contains, andexists. - Response — the payload returned when the scenario matches, authored as JSON or Text.
When a tool declares an output schema, enable Return structured content to author a payload shaped by that schema with the guided builder. The result is emitted as structuredContent on the wire.
Use Add Scenario to create one, the up and down arrows to change priority, and the trash control to remove one. If AI Assist is enabled for your organization, use Generate with AI to draft scenarios from the tool’s schema.
Resource mock content
A resource returns a single body of Mock Content when it is read. Enter JSON, text, or markdown in the content editor; that value is served whenever a client reads the resource.
Prompt mock template
A prompt returns a Mock Template. Write the template text and reference the prompt’s arguments with {argument_name} placeholders — A²D substitutes the supplied argument values when the prompt is rendered.
Summarize the following in a {tone} way: {text}Edits save automatically
Unlike A2A mock scenarios, MCP mock edits are saved automatically. As you change a scenario, resource content, or prompt template, A²D persists the update in the background — there is no separate Save button for MCP mocks. A brief confirmation appears when a change is stored.
Test the mock
Copy the endpoint URL from the MCP Mocking Service tab, or use the in-app Protocol Tester (the Test tab on the server, or the tester in the sidebar) to discover tools and call them against your mock responses.
Next Steps
Mock a server’s tools, resources, and prompts from one place, then call the live endpoint to see the responses exactly as an agent would.