Use Mockflow with an AI agent
Create an Agent Access Key, connect your MCP client, and use natural-language prompts to understand, design, validate, and simulate distributed systems.
Create an Agent Access Key
Each key belongs to one workspace and one approved MCP client. Give every client its own key so you can see where it is used, rotate it, or revoke it without interrupting other clients.
- Open your account menu, choose Settings, and select the workspace the client should access. You can also go directly to Agent Access Keys.
- Choose Create Agent Access Key and enter a name that identifies the client and device, such as
Codex on my laptop. - Choose View diagrams only for explanation and review, Full MCP access for a trusted client that should create, edit, and run work, or Custom access for a smaller grant.
- Choose an expiry. Keys that can make changes must expire within 14 days; Full MCP access starts with a seven-day expiry.
- Review the access summary, create the key, and copy it immediately. Mockflow shows the complete key only once.
Store the key in the client's password setting, your operating system's secret store, or a local environment variable. Never put it in a repository, URL, screenshot, ticket, log, or prompt.
Choose the smallest useful access
View diagrams only
Best for understanding and review. The agent can inspect checkpointed diagram structure, but it cannot change drafts, use authoring tools, or read real stored values.
Full MCP access
Best for a trusted authoring client. It can work across every current and future diagram in the workspace, including real stored values. Journey runs still depend on workspace execution settings.
Custom access
Best for focused automation. Choose the actions and information types the client needs, such as architecture authoring, journeys, contracts, checkpoints, or approved run evidence.
A View diagrams only key exposes authorized read resources and no authoring tools. An empty tool list is expected. Use Custom access when the client also needs journeys, contracts, approved runs, implementation links, or handoff packs.
Connect your MCP client
Add the Mockflow Streamable HTTP server to your client. The server is the API address, not the website address, and the key must be sent as a Bearer Authorization header.
Connection details
Server: https://api.mockflow.app/mcp/v2
Environment variable: MOCKFLOW_AGENT_ACCESS_KEY
Credential: Bearer <Agent Access Key>
Choose your client below. Each example keeps the key in an environment variable or password prompt rather than a tracked project file.
MCP Inspector
Streamable HTTP
- Create a Custom access key with only the information you want to inspect.
- Load the key from your approved secret store into MOCKFLOW_AGENT_ACCESS_KEY.
- Launch Inspector in HTTP CLI mode with the Authorization header below.
- Initialize, list resources, and read the authorized catalog before testing pagination.
# Load MOCKFLOW_AGENT_ACCESS_KEY from your approved secret store.
npx @modelcontextprotocol/inspector \
--cli \
--server-url "https://api.mockflow.app/mcp/v2" \
--transport http \
--header "Authorization: Bearer ${MOCKFLOW_AGENT_ACCESS_KEY}"Use the CLI Authorization header. Do not place the key in the endpoint URL or commit the shell values.
Claude Code
Streamable HTTP
- Choose Full MCP access for a trusted client that needs to create and edit work, or Custom access for a smaller grant.
- Put the key in the environment or an approved local secret store.
- Add the HTTP server entry to the local Claude Code MCP configuration.
- Restart the client, then check that Mockflow appears and the expected tools are available.
{
"mcpServers": {
"mockflow": {
"type": "http",
"url": "https://api.mockflow.app/mcp/v2",
"headers": {
"Authorization": "Bearer ${MOCKFLOW_AGENT_ACCESS_KEY}"
}
}
}
}Keep this configuration local. Never replace the environment placeholders with a key in a tracked repository file.
Visual Studio Code
Streamable HTTP
- Choose Full MCP access for a trusted client or Custom access when it should do less.
- Add the HTTP server and password input to your user or approved local MCP configuration.
- Enter the key in the password input when prompted.
- Start the server and verify resource list/read before relying on it for an agent task.
{
"servers": {
"mockflow": {
"type": "http",
"url": "https://api.mockflow.app/mcp/v2",
"headers": {
"Authorization": "Bearer ${input:mockflow-agent-access-key}"
}
}
},
"inputs": [
{
"type": "promptString",
"id": "mockflow-agent-access-key",
"description": "Mockflow agent access key",
"password": true
}
]
}The key input must remain a password prompt. Do not put the plaintext key directly in mcp.json or workspace settings.
Codex
Streamable HTTP
- Choose Full MCP access if you want Codex to create and edit Mockflow work, or Custom access for a smaller grant.
- Load the key from your approved secret store into MOCKFLOW_AGENT_ACCESS_KEY.
- Run the command below to add Mockflow to Codex.
- Restart Codex, then check that Mockflow resources are available.
# Load MOCKFLOW_AGENT_ACCESS_KEY from your approved secret store.
codex mcp add mockflow \
--url "https://api.mockflow.app/mcp/v2" \
--bearer-token-env-var "MOCKFLOW_AGENT_ACCESS_KEY"This adds a shared server entry. Each Codex client must receive MOCKFLOW_AGENT_ACCESS_KEY from its own launch environment.
Verify the connection
- Close and restart the MCP client after adding the key.
- Ask the client to connect to Mockflow and list the diagrams it can access.
- Ask it to summarize its Mockflow capabilities and any missing permissions or workspace settings.
- Start with a small read request, such as “Explain the checkout diagram without making changes,” before asking it to author or run a larger slice.
What you can do through MCP
Mockflow gives an MCP client a grant-scoped architecture workspace. The client can combine Mockflow with the files, tickets, or repositories it can already access, but it only receives the Mockflow capabilities allowed by the Agent Access Key.
Understand an existing system
Suggested access: View diagrams only; Custom access for journey and contract evidence
Inspect checkpointed architecture and component structure without changing the workspace, then add read access only for the extra evidence the task needs.
Try this prompt
“Open the Checkout Platform diagram and explain the end-to-end purchase flow. Identify every service, queue, data store, external dependency, trust boundary, and modeled failure route. Separate facts from assumptions, do not make changes, and tell me if journey or contract access would provide useful missing evidence.”
Turn a brief into an executable architecture
Suggested access: Full MCP access; Custom needs View diagrams, Create and edit diagrams, View journeys, Create and edit journeys, the Diagrams, Journeys, and Real stored values information types, and journey execution enabled
Create a diagram, choose components from Mockflow's catalog, connect handler-owned interactions, lay it out, and add journeys that prove important routes.
Try this prompt
“Create a Mockflow diagram for a multi-tenant notification platform. Include the public API, tenant and preference services, scheduler, queue, email and SMS workers, provider APIs, database, cache, and dead-letter queue. Model one successful delivery journey and one provider-timeout journey, validate both, and summarize any assumptions.”
Map a codebase into Mockflow
Suggested access: Repository access in the client plus Full MCP access; Custom needs View diagrams, Create and edit diagrams, View journeys, Create and edit journeys, the Diagrams, Journeys, and Real stored values information types, and journey execution enabled
Let an agent that can also read your repository translate real applications, routes, dependencies, queues, and stores into a model while marking uncertain inferences.
Try this prompt
“Study this repository, then create a Mockflow diagram of the system it implements. Trace entry points, service calls, asynchronous messages, data stores, and third-party APIs back to file paths. Add the main user journey and one failure journey. Mark anything inferred rather than evidenced, then validate the result.”
Design APIs, events, and data contracts
Suggested access: Full MCP access; Custom needs View diagrams, View contracts, Create and edit contracts, and the Diagrams, Contracts, and Real stored values information types
Author HTTP operations, message operations, schemas, examples, and logical resources, then use the gap report to find missing bindings or inconsistent shapes.
Try this prompt
“For the Order Service, define the create-order HTTP contract, the OrderAccepted event, and the orders data resource. Include request, success, validation-error, and conflict shapes. Bind each operation to the correct component handler, run the contract gap report, and fix blocking gaps without approving or publishing anything.”
Exercise success and failure journeys
Suggested access: Full MCP access; Custom needs View diagrams, View journeys, Create and edit journeys, the Diagrams, Journeys, and Real stored values information types, and journey execution enabled
Create exact saved journeys with fixtures, run them against the current draft, and inspect bounded event, payload, and failure evidence.
Try this prompt
“Create and run two checkout journeys: a successful card payment and a payment-provider timeout followed by retry exhaustion. Use deterministic fixtures, verify the expected response or failure at each step, and report the actual route, state changes, emitted messages, and first unexpected event.”
Review resilience before an incident
Suggested access: Full MCP access; Custom needs View diagrams, Create and edit diagrams, View journeys, Create and edit journeys, the Diagrams, Journeys, and Real stored values information types, and journey execution enabled
Inspect timeouts, retries, backoff, acknowledgements, dead-letter paths, handler failures, and state mutations, then prove the improved behavior with a journey.
Try this prompt
“Review the payment path for reliability gaps. Check timeout ownership, retry limits, backoff, duplicate delivery, idempotency, queue ACK/NACK behavior, dead-letter routing, and failure responses. Propose the smallest supported changes first; after I confirm, apply them and run a journey that proves the failure route terminates safely.”
Plan a deployment topology
Suggested access: Full MCP access or Custom architecture access
Add a deployment overlay for regions, zones, runtimes, networks, and replicas without changing the logical behavior of the graph.
Try this prompt
“Create a deployment view for the existing checkout system across two regions. Place edge, API, worker, database, cache, and queue workloads into appropriate zones and network boundaries. Show the active-region path and failover dependencies, validate the overlay, and call out where the logical model does not contain enough evidence for a deployment decision.”
Assess a proposed architecture change
Suggested access: Custom diagram, journey, and contract viewing to assess; Full or suitable Custom write access to implement
Use the current model as evidence for change-impact analysis before touching the draft, then apply only an approved bounded slice.
Try this prompt
“Assess what would change if inventory reservation moved from a synchronous request to an event-driven workflow. Trace affected components, contracts, ordering guarantees, failure handling, journeys, and operational trade-offs. Do not edit the diagram yet. Give me a minimal change plan and the journeys we should run to compare the designs.”
Find and repair model gaps
Suggested access: Full MCP access; Custom needs diagram, journey, and contract read and write actions, the Diagrams, Journeys, Contracts, and Real stored values information types, and journey execution enabled
Validate the graph and contracts, find disconnected or non-executable behavior, and make focused repairs while preserving correct work.
Try this prompt
“Audit the Order Processing diagram for validation failures, disconnected components, interactions without arrival-handler behavior, producers without message emission, unbound contracts, missing failure outcomes, and journeys that cannot execute. Rank the findings, fix only blocking issues, then revalidate and run the critical journey.”
Create a review-ready checkpoint
Suggested access: Full MCP access; Custom needs View diagrams, View journeys, Create and edit journeys, View contracts, Create checkpoints, the Diagrams, Journeys, Contracts, and Real stored values information types, and journey execution enabled
Freeze an immutable graph revision with selected journey snapshots after validation, giving reviewers a stable point-in-time model.
Try this prompt
“Prepare the current checkout draft for architecture review. Validate the graph and contracts, run the successful checkout and payment-timeout journeys, summarize unresolved warnings, and create a checkpoint containing the exact validated graph and those saved journeys. Do not approve, publish, share, or export anything.”
Strong prompts name the target diagram, the outcome, the evidence to inspect, whether changes are allowed, and the verification you expect. Ask the agent to mark assumptions whenever the model or connected repository does not provide enough evidence.
Map an existing codebase without sending its source
Open a diagram's Implementation tab when the system already has a repository. Mockflow can give a connected coding agent stable architecture, contract, data-resource, and mapping targets without receiving repository files or credentials.
- Choose Create mapper key. The preset is scoped to this diagram, follows its latest revision, exposes structure only, and expires after seven days.
- Configure the key in the MCP client, then return to the Implementation tab and choose Copy MCP task.
- Run the task from the local repository. The agent lists diagrams, reads the manifest's implementation-context link, and compares stable targets with local files, symbols, manifests, CODEOWNERS, and Git refs.
- Keep evidence metadata-only. Repository paths, symbol names, manifest kinds, CODEOWNERS matches, and Git refs are supported; source snippets, file or manifest bodies, credentials, and arbitrary structured payloads are rejected.
- If the proposal tool is available, let the agent submit one bounded proposal. Otherwise, review its candidate list and keep Mockflow unchanged. Human verification remains a later explicit action.
The implementation-context resource is a projection for discovery. It does not change the authoritative implementation-binding index and never grants the agent access to repository source.
Give the agent a safe working loop
- Discover: list available diagrams, select the target, and read the current model before planning changes.
- Plan: ask for a bounded change slice that includes graph behavior, contracts or resources when needed, and at least one journey that can prove the route.
- Author: let the agent use Mockflow's current component catalog and operation guidance instead of guessing component ports or write shapes.
- Verify: validate the graph, check contract gaps, and run the saved critical journey. A connection alone is not executable behavior; handlers must own the response, failure, or message action.
- Report: summarize evidence, assumptions, unresolved warnings, and exactly what changed. Create a checkpoint only when you need a stable review point.
What MCP deliberately cannot do
MCP can edit drafts, run transient journeys when enabled, validate work, and create checkpoints. It cannot approve contracts, publish work, create approved runs, create share links, or export artifacts. Those remain deliberate owner actions in Mockflow.
A transient journey run is debugging evidence. It does not create an approved run or publish any payload, state, or contract data.
Troubleshooting
| What you see | What to check |
|---|---|
| The client cannot connect | Use the exact server address, send the key as an HTTPS Bearer header, and fully restart the client. Mockflow does not accept credentials in a URL, cookie, or request body. |
| The client says the key is invalid | Use the complete one-time key, and check that it has not expired or been revoked. An HTTP 401 response means the credential was not accepted. |
| The client can read but cannot make changes | The key may use View diagrams only, or workspace MCP writing may be disabled. Create a Full or suitable Custom key for an approved client and ask a workspace owner to enable MCP writing. |
| A capability is missing | Ask the client to read Mockflow's capabilities resource and explain the missing grant or workspace setting. Restart or refresh the client after changing access. |
| Implementation context is missing | Create the mapper key from the diagram's Implementation tab. The key needs architecture, contract, and implementation-binding access, and the client must rediscover the diagram manifest after reconnecting. |
| The agent says its diagram reference is stale | Ask it to list diagrams and reload the current draft before continuing. Do not paste saved internal IDs into prompts. |
| The client reports success but the draft did not change | Ask it to inspect the structured result, reload the current draft, and verify the intended change. Never ask it to blindly retry an old mutation. |
For support, share the time of the problem and the safe key name or public ID. Never share the key itself or logs containing real values.
Continue learning
Read Journeys to learn how Mockflow explains successful and failed system paths, or Contracts and data to model APIs, messages, schemas, and logical resources.