Skip to main content
Glama
BrianGTRxx

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: mcp-api-bridge

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.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A4.7/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool checks running status, port, and collections with item counts, implying a read-only inspection. It does not explicitly say it has no side effects or how errors are handled, but for a status check this is a reasonable level of disclosure. The description adds useful behavioral context beyond the bare tool name.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two sentences, both purposeful. The first sentence defines what the tool does, and the second gives usage context. There is no filler, and the primary function is front-loaded. It is concise without sacrificing clarity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's low complexity (no parameters, no output schema, single sibling), the description is complete. It explains the purpose, the information returned, and the appropriate usage context. Nothing an agent needs to decide whether to call this tool is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has zero parameters, so the input schema is empty and schema coverage is trivially 100%. Per the rubric, a zero-parameter tool receives a baseline of 4. The description does not need to elaborate on parameters, and it does not, which is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's action: 'Checks whether the local mock API is currently running, on which port, and lists its collections with item counts.' It names a specific resource (mock API) and the information it returns, distinguishing it from the sibling setup_mock_api which would be for starting the server rather than inspecting its state.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicit usage guidance is provided: 'Use this before assuming setup_mock_api needs to be called, or to confirm the server an Artifact is calling is actually up.' This tells the agent when to invoke this tool and frames it as a check before potentially calling the sibling, giving clear decision context.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

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.

ParametersJSON Schema
NameRequiredDescriptionDefault
portNoTCP port for the local mock API. Defaults to 3001.
schemaYesMap of resource name to an array of seed objects, e.g. {"tasks": [{"title": "Buy milk", "done": false}], "users": [{"name": "Ana"}]}. Items don't need an id field; one is generated automatically if missing.

TDQS

A5/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries full behavioral burden, and it succeeds: it discloses disk persistence to sandbox_db.json, idempotent behavior for existing collections, supported HTTP methods, and CORS support. These are exactly the side effects and runtime traits an agent needs to predict tool behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Every sentence earns its place: purpose and motivation, resource definition, persistence semantics, and a precondition. Information is front-loaded with the verbs 'Starts (or reconfigures)' and critical behavior follows immediately. No filler or repetition.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The description covers purpose, input shape, endpoint behavior, persistence, reconfiguration semantics, and the sibling tool check. Even without an output schema or annotations, an agent has enough to decide when to call it and how to construct a correct request.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Although the schema covers both parameters, the description adds essential meaning: schema keys become collections at /api/<key>, items get auto-generated IDs if missing, and the server exposes full CRUD. This goes beyond the schema by explaining how inputs map to runtime resources and endpoints.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb+resource: starts/reconfigures a local persistent REST API with CORS support. Clearly distinguishes itself from the sibling get_mock_api_status by naming it as the check step. The description leaves no ambiguity about what the tool accomplishes.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly tells the agent to call get_mock_api_status before invoking this tool to avoid duplicate setup. It also explains the motivating scenario (state persistence across Artifact refreshes). This provides clear when-to-use guidance and names the relevant alternative.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

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

  1. 2 tool updatesv1.0.0
    • First observedget_mock_api_status
    • First observedsetup_mock_api

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

ActivityMaintained
ResponsivenessNo issues

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

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
    Not graded
    quality
    D
    maintenance
    Enables AI assistants like Claude to interact with any REST API through typed, validated MCP tools. Provides a pattern to wrap REST APIs as MCP servers.
    MIT
  • A
    license
    Not graded
    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.
    3,468
    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.
    5,361
    Apache 2.0