mock-server

mock-server is a skill for Claude Code, Codex from JansenAnalytics/claudex. It costs 28 tokens per session (475 once invoked), scanned A, original, MIT.

A small mock API server for frontend development and testing. It returns configured responses, can generate changing values, and can record real API calls for later replay.

In plain words
What is it for?
Use it to define fake API routes, simulate delays and errors, record responses, and replay captured API calls.
Why use it?
It lets frontend work continue without a live backend and makes tests independent of network services or changing data.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is python3 scripts/mock-server.py --config routes.json --port 8080.

Good fit Use it to define fake API routes, simulate delays and errors, record responses, and replay captured API calls.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/JansenAnalytics/claudex
agentmods
npx agentmods add skills/jansenanalytics/claudex/mock-server

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for mock-server

README.md
[![agentmods](https://agentmods.dev/badge/skills/jansenanalytics/claudex/mock-server.svg)](https://agentmods.dev/skills/jansenanalytics/claudex/mock-server)
Your own site
<a href="https://agentmods.dev/skills/jansenanalytics/claudex/mock-server"><img src="https://agentmods.dev/badge/skills/jansenanalytics/claudex/mock-server.svg" alt="Measured on agentmods" height="20"></a>
Per session 28 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 475 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00028 $0.00475
Opus 5 $0.00014 $0.00237
Sonnet 5 $0.00006 $0.00095
Haiku 4.5 $0.00003 $0.00047

Measured 3d ago against content hash 7926994f9284, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

mock-server scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/mock-server/SKILL.md · 80 lines

What it actually says

mock-server

Spin up mock API servers for frontend development and testing: static responses, record/replay real API calls, dynamic response generation.

When to Use

  • Developing frontend without a backend
  • Testing against mock APIs
  • Recording real API responses for replay
  • Isolating frontend tests from backend dependencies

Scripts

mock-server.py

Python mock API server with zero dependencies.

python3 scripts/mock-server.py --config routes.json --port 8080

Config format:

{
  "routes": [
    {
      "method": "GET",
      "path": "/api/users",
      "status": 200,
      "body": [{ "id": 1, "name": "Alice" }]
    },
    {
      "method": "POST",
      "path": "/api/users",
      "status": 201,
      "body": { "id": "{{random_id}}", "created": "{{timestamp}}" },
      "delay_ms": 100
    }
  ]
}

Dynamic templates: {{random_id}}, {{timestamp}}, {{request.body.name}}, {{uuid}}

Supports: regex path matching, custom headers, response delays.

record-replay.py

Record real API calls and replay them.

# Record
python3 scripts/record-replay.py --mode record --target https://api.example.com --port 8081 --output recordings.json

# Replay
python3 scripts/record-replay.py --mode replay --input recordings.json --port 8081

mock-config-gen.sh

Generate mock config from Express/Fastify routes or OpenAPI spec.

bash scripts/mock-config-gen.sh --source routes/ --output mock-routes.json
bash scripts/mock-config-gen.sh --source openapi.yaml --output mock-routes.json

References

  • mocking-strategies.md — When to mock vs use real APIs
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 80 lines · 28 tokens per session scan A 7926994f9284

Subscribe to this mod's changes

mock-server is a skill published in the GitHub repository JansenAnalytics/claudex (5 stars, last pushed 2mo ago), licensed MIT. It adds 28 tokens to every session and 475 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories

api-design

API contract design for REST and GraphQL, covering resource shape, URL and header versioning with deprecation windows, RFC 9457 Problem Details error handling, and OpenAPI specs. Use when specifying the wire contract an endpoint exposes, choosing a versioning scheme, or standardizing error response bodies across…

yonatangross/orchestkit · 76 tokens

API Test Suite Generator

Automatically generate comprehensive API test suites from OpenAPI specifications covering CRUD operations, error handling, authentication, pagination, and edge cases.

PramodDutta/qaskills · 29 tokens

API Contract Validator

Validate API responses against OpenAPI/Swagger specifications, JSON Schema definitions, and consumer-driven contracts to prevent breaking changes.

PramodDutta/qaskills · 26 tokens

api-design

Use when settling the contract of an API you expose, before implementation: resources/URLs, REST vs GraphQL, versioning, one RFC 9457 error envelope, pagination, idempotency — emitted as OpenAPI 3.1. NOT implementing the endpoints (that is fastapi/nestjs/go/nodejs), NOT auth hardening (that is secure-coding), NOT…

ericrisco/rsc-harness · 105 tokens

fastapi-expert

Expert-level FastAPI development for high-performance Python APIs with async support. Use when the user mentions Python, API, async, REST, OpenAPI, or Pydantic, or when the task involves FastAPI Features.

personamanagmentlayer/pcl · 49 tokens

openapi-expert

Expert-level OpenAPI/Swagger specification for API design, documentation, and code generation. Use when the user mentions swagger, API specs, REST, API design, or documentation, or when the task involves OpenAPI Specification, Webhooks, or Polymorphism.

personamanagmentlayer/pcl · 57 tokens