MockAPI for Openclaw

MockAPI is a zero-config CLI tool that transforms a simple JSON file into a full-featured REST API with CRUD operations, filtering, and pagination.

lxgicstudios
v0.1.0
Feb 2, 2026
0
0
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install mockapi

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install mockapi using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is MockAPI?

MockAPI is a powerful utility designed to accelerate the development lifecycle by eliminating the need for a complex backend during the early stages of a project. By leveraging this tool through Openclaw Skills, developers can instantly turn a static JSON file into a live local server that handles HTTP requests just like a production backend. It is an ideal solution for frontend engineers, testers, and prototyper who need reliable, persistent data without the overhead of database management.

The skill provides a standardized way to simulate real-world API behaviors, including simulated network latency and data persistence. When integrated into your workflow using Openclaw Skills, MockAPI ensures that your development environment remains lightweight and highly portable, allowing you to focus on building the user interface while the backend interactions are handled automatically.

MockAPI Use Cases

  • Rapidly prototyping frontend applications without waiting for backend development.
  • Testing UI components under different network conditions using simulated response delays.
  • Demonstrating application features using a read-only local API environment.
  • Streamlining automated testing by providing a predictable and easy-to-reset data source via Openclaw Skills.
  • Training and education where students need a sandbox to practice making RESTful API calls.

How MockAPI Works

  1. Prepare a JSON file (e.g., db.json) where each top-level key represents an API resource.
  2. Launch the MockAPI server using the CLI, pointing it to your data file.
  3. The tool automatically generates standard RESTful routes (GET, POST, PUT, PATCH, DELETE) for every resource defined in the JSON.
  4. Use Openclaw Skills to automate the server lifecycle, including watching for file changes and auto-reloading.
  5. Interact with the endpoints using any HTTP client or frontend framework to perform data operations that persist back to the JSON file.

MockAPI Setup

To install MockAPI for use with Openclaw Skills, run the following command in your terminal:

npm install -g @lxgicstudios/mockapi

To initialize a sample database file:

npx @lxgicstudios/mockapi --init

To start your local server with file watching enabled:

npx @lxgicstudios/mockapi db.json --watch

MockAPI Data Schema & Taxonomy

MockAPI organizes data based on the structure of your JSON file. Each key in the root object is treated as a collection. This makes it easy for Openclaw Skills to identify available endpoints.

Level Component Description
Root Key The name of the API resource (e.g., /users, /posts).
Resource Array A list of objects representing individual records.
Item Object Data entries; must include a unique id for CRUD operations.

Example db.json structure:

{
  "users": [
    { "id": 1, "name": "Alice" }
  ]
}

MockAPI Advanced Features

  • Support for complex queries including filtering by property, sorting (_sort), and ordering (_order).
  • Built-in pagination using _page and _limit parameters to handle large datasets efficiently.
  • Simulated network latency via the --delay flag to test asynchronous UI states.
  • Read-only mode to protect your JSON data source during public demonstrations.
  • Full CORS support enabled by default for seamless integration with browser-based applications using Openclaw Skills.
  • Automatic ID generation for new items created via POST requests.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*