Testing & QA

Mock API Server

Generate mock API servers from OpenAPI/Swagger specs. Serve realistic responses without hitting real APIs. Perfect for frontend development and testing.

Get the CLI Tool

Run mock API servers locally as an MCP server, or try it online below.

npx @clinetools/mock-api
Requires Node.js 18+
  • Parses OpenAPI 3.0/Swagger specs and generates mock endpoints
  • Realistic response data based on schema types and examples
  • Simulates latency, errors, pagination, and auth flows
  • Hot-reload: update spec, server updates automatically
  • Preference conversation on first run — port, latency, error rate

How to Use It

Three ways to mock APIs — pick the one that fits your workflow.

1

Try Online

Paste an OpenAPI spec below to preview mock responses — no install needed.

2

Use via CLI

Run as a local mock server. On first run it asks about your server preferences.

npx @clinetools/mock-api
3

Add to Cline / Claude Code

Add to your MCP settings so your agent can spin up mock servers.

"mock-api": { "command": "npx", "args": ["@clinetools/mock-api"] }

MCP Client Configuration

{
  "mcpServers": {
    "mock-api": {
      "command": "npx",
      "args": ["@clinetools/mock-api"]
    }
  }
}

Example: Mock from Spec

// Prompt to your AI agent:
"Start a mock server for our API spec
so I can develop the frontend"

// The agent calls:
start_mock_server({
  spec_path: "openapi.yaml",
  port: 3001,
  latency: "50-200ms",
  error_rate: 0.05
})

// Server starts at localhost:3001
// All endpoints return realistic mock data
Live Demo

Try It Online

Paste an OpenAPI spec or try a demo to see generated mock responses.

Paste OpenAPI Spec (JSON)

We parse your spec and generate mock responses for each endpoint

Try a demo:

Paste an OpenAPI spec and click Generate Mock Server to preview endpoints.

Endpoints (click to preview response)

Why Mock APIs Matter

Don't wait for the backend. Build faster with realistic mock data.

Parallel Development

Frontend and backend teams work simultaneously. Mock the API contract, build the UI, and integrate once the real API is ready. No more waiting for endpoints.

Reliable Testing

Real APIs are flaky: rate limits, downtime, changing data. Mock servers return consistent, predictable responses. Your tests pass every time, not just when the API is up.

Error Simulation

Test how your app handles 500 errors, timeouts, and rate limits. Mock servers can simulate failure scenarios that are hard to reproduce with real APIs.

Zero API Costs

Stop burning through API credits during development. Mock servers cost nothing to run and respond instantly. Save real API calls for production and integration tests.

Mock Any API In Seconds

Add the Mock API Server to your agent's toolkit and develop without backend dependencies.

View Plans