mock-serverlisted
Install: claude install-skill aiskillstore/marketplace
# 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
```
@mock-server
@mock-server --from-openapi
@mock-server --port 3000
@mock-server --with-delays
@mock-server --graphql
```
## JSON Server (Simple Mock)
### Quick Setup
```bash
# Install
npm install -g json-server
# Create db.json
cat > db.json << EOF
{
"users": [
{ "id": 1, "name": "John Doe", "email": "john@example.com" },
{ "id": 2, "name": "Jane Smith", "email": "jane@example.com" }
],
"posts": [
{ "id": 1, "title": "Hello World", "userId": 1 },
{ "id": 2, "title": "Mock APIs", "userId": 2 }
]
}
EOF
# Start server
json-server --watch db.json --port 3000
```
###