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/github.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/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for mock-server

Your own site · 80×15
<a href="https://agentmods.dev/skills/jansenanalytics/claudex/mock-server"><img src="https://agentmods.dev/badge/skills/jansenanalytics/claudex/mock-server.svg" alt="Reviewed on agentmods" width="80" 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.5 $0.00011 $0.00190
Sonnet 5.5 $0.00006 $0.00095
Haiku 4.5 $0.00003 $0.00047

Measured 2mo ago against content hash 7926994f9284, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-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 2mo 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. 2mo 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 5mo ago), licensed MIT. It adds 28 tokens to every session and 475 once invoked, about $0.0001 per session on Opus 5.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

mock-server compared with skills from other repositories

mock-server next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
mock-serverJansenAnalytics/claudexSkill55mo agoMITA28Claude Code, Codex
api-designericrisco/rsc-harnessSkill6825d agoMITA105Claude Code, Codex
fastapi-expertpersonamanagmentlayer/pclSkill461mo agoApache-2.0A49Claude Code
openapi-expertpersonamanagmentlayer/pclSkill461mo agoApache-2.0A57Claude Code
construtor-de-apiricneves-ai/flowgrammers-skillsSkill1182mo agoMITA46Claude Code, Codex
api-design-patternsorganvm-iv-taxis/a-i--skillsSkill173mo agoApache-2.0A54Claude Code
mockapidevctllabs/mockapiSkill31mo agoApache-2.0A72Codex