Mock APIs from Claude Code, Cursor, and Windsurf via MCP
If your AI coding agent can't reach out to a mock API, it can't help you test the integration. Here's how to wire RequestBin into Claude Code, Cursor, and Windsurf via MCP — and the 5 tools that let an agent drive the full mock-and-inspect workflow.
An AI coding agent that can write your integration code but can't verify it works against a known-good mock endpoint is doing half the job. You write a Stripe webhook handler, the agent suggests it'll work, you run it against… nothing.
That's the gap the RequestBin MCP server (free on every plan) fills. Five mock tools, available inside Claude Code, Cursor, Windsurf, or any MCP-compatible client.
The tools
| Tool | What it does |
|---|---|
list_mock_endpoints | List your mocks with slug, URL, and rule count. |
create_mock_endpoint | Create a mock + get a live {slug}.rbmock.dev URL. |
add_mock_rule | Append a routing rule (match method/path → status + headers + body). |
deploy_mock | Publish the rule set so the live mock server picks it up. |
list_mock_captures | List recent requests that hit the mock — verify your integration is actually calling it. |
Setup (Claude Code)
Add this to your ~/.claude/claude_desktop_config.json (or Cursor's ~/.cursor/mcp.json):
{
"mcpServers": {
"requestbin": {
"command": "npx",
"args": ["-y", "@requestbin/mcp-server"],
"env": {
"REQUESTBIN_API_KEY": "rb_your_api_key_here"
}
}
}
}Get the API key from requestbin.net/api-keys — FREE plan includes 5 API keys.
What the workflow looks like
Once the MCP server is wired up, an AI agent can drive the full create-configure-deploy-verify loop. Example conversation with Claude Code:
You: "I'm building a Stripe webhook handler. Create a mock endpoint that returns a fakepayment_intent.succeededevent so I can test my code."
Claude Code: Callscreate_mock_endpoint→ gets URLabc12.rbmock.dev. Callsadd_mock_rulewith the Stripe event payload. Callsdeploy_mock. Reports the URL to you.
You: "Point my handler at the URL and call it."
Claude Code: Updates your code, runscurlagainst the mock to trigger your handler. Then callslist_mock_capturesto confirm the request actually hit the mock with the right method, path, and body.
The whole loop runs without leaving the editor.
Why this matters
Most webhook-testing tools were built before AI coding agents existed. They assume a human will click around a web UI. That doesn't compose with agent-driven development.
The fix isn't "an MCP server that lets the agent see your mocks" — it's "an MCP server that lets the agent BUILD the mocks." Five tools cover the loop end-to-end:
- Create the mock (the agent owns the URL)
- Configure rules (the agent decides what responses to return)
- Deploy (no human in the loop)
- Trigger your code to hit it
- Verify by inspecting captures (the agent closes the loop itself)
FREE plan included
API keys and the MCP server are open on every plan, including FREE (5 keys per account). You can run the entire above workflow without paying. The paid tier kicks in at scale — more mocks, more rules per mock, custom subdomains, longer retention.