Skip to main content
Glama
api-mock-sandbox

api-mock-sandbox

by BrianGTRxx

API Mock Sandbox

An MCP server that gives Claude two tools for spinning up a local, persistent REST mock API on demand: describe the data you need in plain language, get a working CRUD backend a few seconds later, with data that survives restarts because it's written to disk instead of kept in memory.

Full documentation, in English and Spanish, lives in docs/:

Quick start

npm install
npm run build

Then register it in claude_desktop_config.json:

{
  "mcpServers": {
    "api-mock-sandbox": {
      "command": "node",
      "args": ["ABSOLUTE_PATH_TO_PROJECT/dist/index.js"]
    }
  }
}

Restart Claude Desktop, then ask it to set up a mock API for whatever you're building. See the full guide for tool parameters, the REST endpoint reference, and troubleshooting.

Before you plan a project around Claude Artifacts calling this API: they can't. Published Artifacts run in a CSP sandbox that silently blocks requests to localhost. Read docs/en/LIMITATIONS.md for why, and for the local test console (public/index.html, served at http://localhost:<port>/) that works instead.

Related MCP server: ObsidianMCP

License

MIT


Built with Claude Code.

Available Tools

2 tools
get_mock_api_statusGet Mock API StatusA

Checks whether the local mock API is currently running, on which port, and lists its collections with item counts. Use this before assuming setup_mock_api needs to be called, or to confirm the server an Artifact is calling is actually up.

Inputs: no named parameters.

setup_mock_apiSetup Mock APIA

Starts (or reconfigures) a local, persistent REST API that a Claude Artifact can call directly (fetch) with full CORS support, instead of losing state on every refresh. Give it a schema describing the resources you need as seed data; each key becomes a collection served at http://localhost:/api/ supporting GET/POST/PUT/PATCH/DELETE. Data is written to sandbox_db.json next to this server and survives across Artifact refreshes and tool calls: collections that already exist from a previous call are left as-is, not overwritten. Use get_mock_api_status to check whether a server is already running before calling this.

Inputs: schema (required), port.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.6/5.0

    Scored across 2 tools

    Disambiguation5/5

    The two tools have clearly distinct roles: one creates/reconfigures the mock API and the other queries its runtime status. There is no overlap or ambiguity between them.

    Naming Consistency5/5

    Both tool names follow a consistent verb_noun pattern using snake_case: setup_mock_api and get_mock_api_status. The style is uniform and predictable.

    Tool Count4/5

    With only two tools, the surface is minimal but arguably appropriate for a focused mock server utility. It feels slightly thin for a full lifecycle but is not unreasonable.

    Completeness3/5

    The set covers setup and status checking, but lacks obvious lifecycle operations like stopping/resetting the server or clearing collections. Agents can work around this, but the surface leaves gaps.

    Maintenance

    ActivityStale
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Turns any CLI tool or REST API into an MCP server for Claude, enabling Claude to use git, databases, or any API through natural language.
      MIT
    • A
      license
      B
      quality
      D
      maintenance
      Enables Claude to interact with an Obsidian vault via the Local REST API plugin, supporting file operations, search, periodic notes, commands, and semantic search.
      22
      3,500 npm
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables Claude Desktop to interact with an Obsidian vault through the Local REST API, allowing file listing, reading, searching, creating, and updating markdown notes.
      4,522 npm
      Apache 2.0