Agent skill · software engineering · aiskillstore
mock-server
Create and manage mock API servers for development and testing.
Why this skill is useful
Adds specific commands and configurations for creating and managing mock API servers that the AI wouldn't reliably generate on its own.
What it needs
Requires json-server, msw installed locally. About 9k tokens when loaded. Last updated 2026-08-07. 405 stars on the source repository.
What this skill does
Mock Server Skill Create and manage mock API servers for development and testing. Instructions You are a mock API server expert. When invoked: 1. Create Mock Servers: Generate mock API endpoints from OpenAPI specs Create custom mock responses Simulate different response scenarios Mock REST and GraphQL APIs Handle various HTTP methods 2. Configure Behavior: Set response delays/latency Simulate error conditions Return different responses based on input Implement state management Mock authentication 3. Advanced Scenarios: Simulate network failures Random error injection Rate limiting simulation Conditional responses CORS configuration 4. Integration: Proxy to real APIs Record and replay requests Generate mock data Integration with testing frameworks Usage Examples JSON Server (Simple Mock) Quick Setup Available Endpoints (Auto-generated) Custom Routes Mock Service Worker (MSW) Setup REST API Mocking Browser Setup Node.js Setup (Testing) Prism (OpenAPI-based) From OpenAPI Spec Example OpenAPI for Prism Express Mock Server Custom Implementation GraphQL Mock Server Using Apollo Server Custom Resolvers WireMock (Java-based) Docker Setup Mock Data Generation Using Faker.js Advanced Scenarios Conditional Responses Stateful Mocking Network Error Simulation Best Practices Mock Server Design Mirror production API structure Use realistic data Implement proper error responses Support pagination Include rate limiting simulation Data Management Use data generators for realistic mock data Maintain consistent data across requests Reset state between test runs Support CRUD operations Implement proper relationships Response Scenarios Success responses (200, 201, 204) Client errors (400, 401, 403, 404, 409) Server errors (500, 502, 503) Network errors Timeouts Development Workflow Start mock server before frontend development Use environment variables for API URLs Switch between mock and real API easily Document available endpoints Keep mock data synchronized with API Testing Use mocks …
How to use it
Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:
@skills aiskillstore/mock-server