mockapi

A tool for creating stateful mock application programming interfaces from OpenAPI 3.0 or 3.1 contracts. OpenAPI is a format that describes how an API works.

In plain words
What is it for?
Building or repairing TypeScript/Hono mock servers, validating mock profiles, generating admin state endpoints, and working with .mockapi behavior files.
Why use it?
It provides a defined way to test API-based software before the real service is available, while checking the contract and simulated behavior.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/devctllabs/mockapi/mockapi
Any agent
npx skills add devctllabs/mockapi --skill mockapi
Clone the repo
git clone --depth 1 https://github.com/devctllabs/mockapi

Made for: Claude Code, Codex.

Per session 72 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,354 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00072 $0.01354
Opus 5 $0.00036 $0.00677
Sonnet 5 $0.00014 $0.00271
Haiku 4.5 $0.00007 $0.00135

Measured yesterday against content hash 7e39f1964dfc, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

mockapi 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 yesterday.

The scan reads SKILL.md. This mod also ships 41 executable files (assets/templates/mock-server/scripts/build.mjs, assets/templates/mock-server/scripts/codegen-admin-openapi.ts, assets/templates/mock-server/scripts/lib/mockRuntimeCodegen.ts, …), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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/mockapi/SKILL.md · 132 lines

How it starts

The opening of the file, as written. The whole thing — 132 lines — stays where its author put it; the contents beside it link to each section on GitHub.

mockapi

Use this skill to create stateful mock API servers from OpenAPI contracts. The agent owns behavior analysis and sidecar authoring; bundled scripts only perform structural validation and deterministic typed scaffolding. Generated operation services are TODOs; the agent completes wiring and behavior from .mockapi/behavior.md anchors.

Command Router

Route invocations:

  1. No argument: show a short menu with profile, generate, and freeform examples. Ask what the user wants to do.
  2. First word profile: read reference/profile.md and follow that workflow. Everything after profile is the target or context.
  3. First word generate: before any OpenAPI search or repo-wide file scan, read reference/generate.md and run the generate sidecar preflight from that workflow. Everything after generate is the target or context. After the profile and sidecars are present and validation succeeds, always run <python> <skill-root>/scripts/generate.py; do not satisfy a generate command by only describing, planning, or hand-writing the scaffold.
  4. Any other first word: treat the entire argument as a general mockapi request. Do not reject unknown first words merely because they are not commands.

General mockapi request routing:

  • Mock-server creation requests such as "make", "build", "create", "generate", "scaffold", or "use this OpenAPI" route to reference/generate.md. generate auto-runs the profile workflow when sidecars are missing.
  • Profile, analyze, describe, or sidecar-only requests route to reference/profile.md.
  • Validate, check, repair, or diagnose sidecar requests run scripts/validate_profile.py, read reference/sidecars.md, and repair or report blockers as needed. The validator checks profile.toml and behavior.md unless --profile-only is used.
  • Questions about existing generated mock-server code read reference/generated-server.md, reference/mock-server-structure.md, and reference/mock-server-examples.md, then inspect the relevant files. When finishing or reviewing LLM-owned generated server code, also read reference/mock-server-quality.md.

Read the full file on GitHub · 132 lines

Files

What ships with it

60 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. yesterday First seen · 132 lines · 72 tokens per session scan A 7e39f1964dfc

Subscribe to this mod's changes

mockapi is a skill published in the GitHub repository devctllabs/mockapi (3 stars, last pushed 1mo ago), licensed Apache-2.0. It adds 72 tokens to every session and 1,354 once invoked, about $0.0004 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-08-31.

Related

Other skills, from other repositories

ocli-api

Turn any OpenAPI/Swagger API into CLI commands and call them. Search endpoints with BM25, check parameters, execute — no MCP server needed.

EvilFreelancer/openapi-to-cli · 34 tokens

skmtc-architecture

Understand what SKMTC is, how its engine works, and the architectural invariants — for agents building or extending infrastructure around SKMTC rather than authoring generators or running the CLI. Covers the three-phase pipeline, the host/Worker boundary, cross-generator coordination, the manifest, the attribution /…

skmtc/skmtc · 240 tokens

skmtc-debug

Diagnose failures in SKMTC sessions — no output, wrong output, error messages, bundle freshness, parseIssues, "Registered definition mismatch", ref cycles, "Module not found" in generated code, or any other broken behavior. Applies across both CLI usage and generator authoring contexts. Use this skill when the user…

skmtc/skmtc · 213 tokens

skmtc-lang-kotlin

The Kotlin target-language layer for Skmtc generators (@skmtc/lang-kotlin): base factories, KtSnippet, the seven entity kinds, packages-from-paths imports, the head+value render model, KtAnnotation and the composition classes, sanitization and @SerialName placement, plus the current-API worked example (the shipped…

skmtc/skmtc · 117 tokens

skmtc-retro-review

Aggregate friction log files across a time period to identify recurring patterns, classify each cluster by intervention type, produce a prioritized action plan with success criteria, and calculate convergence metrics. Complements skmtc-retro (which captures per-session signal) by acting as the system's actuator…

skmtc/skmtc · 211 tokens

skmtc-retro

Run a self-retrospective on a SKMTC-related session — generator authoring, CLI configuration, debugging, or any sustained interaction involving @skmtc/core, @skmtc/cli, or @skmtc/gen- packages. Captures three distinct outputs: (1) friction entries (mistakes, surprises, overridden defaults, multi-cycle struggles), (2)…

skmtc/skmtc · 311 tokens