MCP Mocking
MCP mocking is standing up a realistic mock of a Model Context Protocol (MCP) server — its tools, resources, and prompts — so clients and AI agents can be built and tested before the real server exists. In A²D you design the MCP server specification and instantly serve a secure mocking endpoint, with configurable success and error scenarios for every tool, no code required.
If you have never built an MCP server in A²D, start with Creating your first MCP server. This guide focuses on the mocking layer specifically.
What gets mocked
An MCP server mock in A²D reproduces the full protocol surface a client would call:
- Tools — callable operations with input schemas and mocked outputs.
- Resources — addressable content the server exposes to the model.
- Prompts — reusable prompt templates with arguments.
- Authentication — the auth type clients must present, exercised end to end.
Because the mock is generated from the spec, it always matches the contract clients will code against.
Design the server, get a mock
The mock is a direct product of the design — there is no separate mock-server to wire up:
- Define the MCP server and add tools, resources, and prompts.
- For each tool, add one or more mock scenarios (success, empty, error).
- A²D serves the mock at a secure endpoint you can point any MCP client at.
- Switch environments (Mock, Pre-prod, Prod) without changing the client.
{
"tool": "search_orders",
"scenario": "success",
"result": {
"orders": [
{ "id": "ORD-1001", "status": "shipped", "total": 129.5 }
],
"nextCursor": null
}
}Scenarios make the mock realistic
Real servers return more than one shape of response. Add a scenario per case so agents can be tested against all of them:
- Success — the happy path with representative data.
- Empty — valid call, no results (tests agent handling of nothing found).
- Error — protocol or business errors so failure handling is covered.
Select the active scenario per tool when you run a test or explore in the playground.
Try and test the mock
Once the mock is serving, exercise it two ways:
- Interactively in the Protocol Tester playground — call tools and inspect responses live.
- Automatically with the testing framework — build suites and track coverage across environments.
Next Steps
- Testing MCP endpoints - Exercise your mocked tools
- Structured content - Add output schemas to responses
- API mocking - Design-first mocking for REST and MCP
- Real-world mocking for MCP and agents - The full workflow
Design once, mock instantly — build and test MCP clients before the real server exists. 🧩