Api Mock Server
Helps with API, server as part of agent workflows workflows.
Install on your platform
We auto-selected Claude Code based on this skill’s supported platforms.
Run in terminal (recommended)
claude mcp add api-mock-server npx -- -y @trustedskills/api-mock-server
Or manually add to ~/.claude/settings.json
{
"mcpServers": {
"api-mock-server": {
"command": "npx",
"args": [
"-y",
"@trustedskills/api-mock-server"
]
}
}
}Requires Claude Code (claude CLI). Run claude --version to verify your install.
About This Skill
What it does
This skill enables AI agents to create realistic mock APIs for testing and development purposes. It supports three different approaches: MSW, json-server, or custom implementations. The agent can define endpoint handlers, set up test data (fixtures), configure success/error scenarios, integrate these mocks into test suites, and document the API contract created by the mock.
When to use it
- When you need to test an application against an API that is not yet available or stable.
- For development purposes when simulating backend behavior without relying on a live server.
- To create isolated testing environments for specific features or components.
- When needing to control the responses from an API to reproduce edge cases or error conditions.
Key capabilities
- Supports three mocking approaches: MSW, json-server, and custom implementations.
- Allows defining mock endpoint handlers with configurable success and error states.
- Enables setting up test data (fixtures) for realistic simulations.
- Provides the ability to integrate mocks into existing test suites.
- Facilitates documenting API contracts based on the created mocks.
Example prompts
- "Create a mock API endpoint using MSW that returns a list of users."
- "Simulate a POST request to /api/users with a 201 status code and return the newly created user data."
- "Generate test data for a GET request to /api/users/:id, where id is '1'."
Tips & gotchas
- The skill supports MSW, which requires initial setup (
npm install -D mswandnpx msw init ./public --save). - You will need to define handlers (e.g., in a
mocks/handlers.tsfile) to specify the behavior of each mock endpoint. - The skill allows for delays using
await delay(100)within handler definitions, simulating network latency.
Tags
TrustedSkills Verification
Unlike other registries that point to live repositories, TrustedSkills pins every skill to a verified commit hash. This protects you from malicious updates — what you install today is exactly what was reviewed and verified.
Security Audits
| Gen Agent Trust Hub | Pass |
| Socket | Pass |
| Snyk | Pass |
🌐 Community
Passed automated security scans.