- Home
- Skills
- APIs & Backend
- Mockaton
Works with the AI Agents you already use
Mockaton
A file-system based HTTP mock API server
Free
Mockaton
Example session with this skill installed
Create a mock API for a GET request to /api/users/42 that returns a user profile, and another variant for a 404 error.
- Read your context and instructions
- Compiled the mockaton
I have created the mock directory structure and the two response variants (success and not found) for the user profile endpoint.
Mock API Configuration
| Type | Path | Filename |
|---|---|---|
| Success | /api/users/42 | api/users/[id](default).GET.200.ts |
| Error | /api/users/42 | api/users/[id](not found).GET.404.json |
Success Variant (TypeScript)
// api/users/[id](default).GET.200.ts
interface User {
id: number;
username: string;
email: string;
role: string;
}
export default {
id: 42,
username: "jdoe_dev",
email: "john.doe@example.com",
role: "admin"
} satisfies User
Not Found Variant (JSON)
// api/users/[id](not found).GET.404.json
{
"error": "User not found",
"code": "USER_MISSING",
"message": "The requested user ID does not exist in the database."
}
Next steps
- Run
mockaton --port 2020 ./my-mocks-dirto start the server. - Update your frontend environment variable to point to
http://localhost:2020. - Rename the
(not found)file to(default)when you need to test error handling logic.
Connects securely to your tools. The creator never sees your data.
About this skill
Frontend development often stalls when the backend isn't ready. Mockaton eliminates this bottleneck by serving mock HTTP APIs directly from your file system. It maps directory structures and filenames to RESTful routes, allowing you to prototype and test against realistic data without writing a full server implementation.
What it does
- File-system routing translates directory paths and filenames into API endpoints automatically.
- Dynamic parameters use bracket syntax like
[id]to handle variable URL segments. - Variant management utilizes parentheses to store multiple mock scenarios (e.g., success, error, edge cases) for the same route.
- Multi-format support serves TypeScript, JavaScript, JSON, and static assets like images or XML.
- Function mocks enable complex logic, URL parsing, and stateful responses using standard Node.js request/response objects.
How it works
- Initialize a mocks directory and install the CLI tool via npm.
- Create files using the naming convention
path/name(comment).[METHOD].[STATUS].[ext]. - Launch the server pointing the CLI at your directory to begin serving the API on a local port.
- Switch variants by using the
(default)comment or selecting specific mocks via the programmatic API.
Frameworks & tools
This tool is a Node.js application with zero dependencies. It supports TypeScript, JavaScript, JSON, XML, and standard media formats.
Why this beats prompting it yourself
Manual mocking often results in brittle, single-use scripts or bloated hardcoded objects. This skill enforces a consistent, scalable structure that mirrors real-world routing patterns, ensuring your mocks are organized, reusable, and easy to toggle between different states.
Use cases
- Scaffold a backend for a new React or Next.js frontend before the API exists.
- Simulate error states like 401 Unauthorized or 423 Locked Out to test UI resilience.
- Create dynamic endpoints that parse URL segments to return specific data.
- Host static assets and media files alongside JSON data for a complete frontend environment.
Known limitations
Requires Node.js for execution. Complex stateful logic requires manual implementation via function mocks. TypeScript files are served as JSON by default unless using the function mock syntax.
Requires Node.js. Function mocks require manual implementation for stateful logic. TypeScript files default to JSON output.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before any payment.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
1 use
Times used to date
Free forever
No account required to browse
Trust & safety
Security scan
Security scan passed 27 days ago
- Free with an Agensi account
Requires