Workflow·API Development

Scalar Mock Server

Build, customize, and troubleshoot OpenAPI mock servers with @scalar/mock-server, including x-handler, x-seed, authentication, and Docker.

You say
Buy it · $15 Read it before you buy $15 Written by scalar · unverified publisher
Context cost
1k tokensestimated from the bundle, loaded when it triggers
Bundle
1 file · 4.1 kBtext throughout, nothing executable
Licence
MITpaid listing
Last change
no release on file
Servers it uses
Noneruns standalone

What it does

Build, customize, and troubleshoot OpenAPI mock servers with @scalar/mock-server, including x-handler, x-seed, authentication, and Docker.

Installed, it changes the agent in these ways.

What this skill changes about the agent is not written down here yet. The listing was collected from its source, and the description is in its own SKILL.md.

Workflow

Runs a procedure end to end.

openapimockingtestingapi
Filed under

API Development

The skill itself

This is the whole product. A skill is instructions the model reads, so there is nothing behind the listing you cannot see first — the front matter loads with every session, and the body below it loads when the skill triggers.

SKILL.md4.1 kB · 129 lines
--- name: mock-server description: Build, customize, and troubleshoot OpenAPI mock servers with @scalar/mock-server, including x-handler, x-seed, authentication, and Docker. ---
6# Scalar Mock Server Skill
7
8Reference for implementing and debugging mock APIs with @scalar/mock-server.
9Use this when you need realistic API responses from an OpenAPI description document, custom request behavior, seeded data, or Docker-based mock environments.
10
11## Overview
12
13- Package: @scalar/mock-server
14- Runtime: Node.js (package engine: >=22)
15- Main API: createMockServer(options)
16- Docs:
17 - Getting started: <https://scalar.com/tools/mock-server/getting-started>
18 - Custom request handlers (x-handler): <https://scalar.com/tools/mock-server/custom-request-handler>
19 - Data seeding (x-seed): <https://scalar.com/tools/mock-server/data-seeding>
20 - Docker: <https://scalar.com/tools/mock-server/docker>
21
22## Quick Start
23
24Fastest way to run a mock server from a local OpenAPI description:
25
26```bash
27npx @scalar/cli document mock openapi.json --watch
28```
29
30Programmatic setup:
31
32```ts
33import { serve } from '@hono/node-server'
34import { createMockServer } from '@scalar/mock-server'
35
36const app = await createMockServer({
37 document: './openapi.yaml',
38 onRequest({ context, operation }) {
39 console.log(context.req.method, context.req.path, operation.operationId)
40 },
41})
42
43serve({ fetch: app.fetch, port: 3000 })
44```
45
46## createMockServer() Options
47
48At least one of the following is required:
49
50- document: OpenAPI description document as URL, file path, or object
51- specification: deprecated alias for document
52
53Optional:
54
55- onRequest({ context, operation }): callback before each request is processed
56
57## Built-in Behavior
58
59When the server starts, it:
60
611. Processes and loads the OpenAPI description document.
622. Seeds schema data from x-seed extensions (idempotent: only when collection is empty).
633. Registers authentication routes for declared security schemes.
644. Registers operation routes for each path + method.
655. Exposes the source document at:
66 - /openapi.json
67 - /openapi.yaml
68
69## Custom Request Logic with x-handler
70
71Use x-handler in an operation for dynamic behavior instead of static examples.
72
73Helpers available in x-handler:
74
75- store for in-memory persistence (list, get, create, update, delete, clear)
76- faker for generated test data
77- req for request data (body, params, query, headers)
78- res for response examples by status code (res['200'], res['404'], ...)
79
80Status behavior:
81
82- store.get() / store.update() => 200 when found, 404 when not found
83- store.create() => 201
84- store.delete() => 204 when deleted, 404 when not found
85- store.list() => 200
86- Returning null/undefined triggers 404 (uses responses.404 example/schema when provided)
87
88## Seed Data with x-seed
89
90Use x-seed on components.schemas.<SchemaName> to seed initial data at startup.
91
92Helpers available in x-seed:
93
94- seed.count(n, factory)
95- seed(array)
96- seed(factory) (single item shortcut)
97- faker, store, and schema
98
99Key rule: the schema key name is used as the collection name.
100
101## Docker Usage
102
103Run the Docker image:
104
105```bash
106docker run -p 3000:3000 scalarapi/mock-server --url https://api.example.com/openapi.yaml
107```
108
109Document source priority (high to low):
110
1111. --url <URL>
1122. OPENAPI_DOCUMENT
1133. OPENAPI_DOCUMENT_URL
1144. /docs volume-mounted files
115
116Useful routes:
117
118- Mock endpoints: from your OpenAPI paths
119- API reference UI: /scalar
120- Description document: /openapi.json, /openapi.yaml
121
122## Troubleshooting Checklist
123
124- Confirm the OpenAPI description document is valid and reachable.
125- Confirm at least one document source is configured (document, --url, env var, or mounted file).
126- If seeded data is missing, check x-seed exists on schema keys and the collection was empty on startup.
127- If auth-protected routes return unauthorized responses, verify matching securitySchemes and request credentials.
128- If custom logic fails, inspect x-handler runtime errors (mock server returns 500 with handler error details).
129
In the file
SKILL.md526 words
Files1
LicenceMIT
Why you can read it

Nothing in a skill executes. The client loads the text and the model follows it, so a skill can be audited the way a runbook is — by reading it.

What it costs in context

Skills are not billed by the call. They are paid for in context: every token the instructions occupy is a token your code, your diff and your conversation cannot use. Here is what this one takes and when it takes it.

≈40
always loaded
The name and description, so the model knows the skill exists and when to reach for it.
985
on trigger
The instruction body, read only when the skill fires.
0.51%
of a 200k window
Ten skills this size would take about 5% of the window before you open a file.
050k100k150k200k context window

1k tokens, estimated from the bundle at four bytes to the token, held for the rest of the session once it triggers. Small enough to keep loaded permanently without thinking about it.

Servers bill, skills cost

A server charges by the month. A skill charges once per session, in context, and then keeps charging it for as long as the session lives.

Before and after

The same question, put to the same model twice: once as it comes, and once with these instructions loaded.

No worked example has been published for this skill yet.

Adoption
Installsnone yet
Ratingno reviews yet

The procedure it runs

The procedure has not been published here. It is in the skill’s own SKILL.md, which its author has not sent to the marketplace yet.

Prose, not code

These steps are written for a model to follow, not executed by a runtime. It can still be told to skip one, and it will say so when it does.

Servers it uses

None. This skill calls no MCP servers at all.

Everything it needs is in the instructions, so it works in a project with nothing connected — the model reads the file and changes how it works with what it can already reach.

It writes no files and reaches no network. All it changes is how the model reasons and writes.

What it asks for
Writes filesno
Network accessno

Read from the allowed-tools line of this skill’s own SKILL.md. A skill grants no permissions of its own — it can only ask for tools your client already has.

What it will not do

Every skill is narrow, and the useful ones say where they stop. These are the jobs this one is the wrong tool for.

What this skill is not for has not been published here. Nothing is implied by that: it is a section the author has not filled in.

What is in the bundle

1 file, 4.1 kB on disk. A bundle is text throughout: the instructions the model reads, plus the templates it fills in.

  • SKILL.md4.1 kB
What is not in it

No dependencies and nothing executable: a skill is text the agent reads, so the bundle is 1 file you can review in full before installing. The MIT licence covers the templates and examples as well as the instructions.

Install

Installing copies the bundle into your project. Nothing runs at install time — the files sit on disk until the model reads them.

$15 once
Scalar Mock Server · MIT · scalar
one-time
Price$15 once
LicenceMIT — the author’s, unchanged by this purchase
Paid throughStripe, once, on the card you add at the checkout
Keeps workingfor good — the files are yours once they are on disk
Updatesevery update its author ships, delivered through this account

You can read the whole bundle before paying — the SKILL.md above is the product, not a preview of it. What the money buys is the delivery: the folder packaged and handed to your machine by key, every update its author ships, and our support if it does not do what this listing says. The terms of use are MIT, set by the author and unchanged by buying it here.

Payment runs through Stripe, on a page like this one rather than a redirect. Once there is an account it joins the same mcprush invoice as everything else you run, so there is never a second card to enter.

Which clients pick it up on their own

A skill is a folder of text. A client with a skills folder reads it without being told; everywhere else the same text works, it is just handed to the model rather than found.

Claude Code.claude/skills/
Claude Desktop
ChatGPT
Cursor.cursor/skills/
VS Code.github/skills/
Codex CLI.agents/skills/
Gemini CLI.gemini/skills/
Grok.grok/skills/
Zed.agents/skills/
Windsurf.windsurf/skills/
Agent SDK.claude/skills/
HTTP / API
This release
Versionnot versioned
Publishedno release date on file
Price$15
Referencescalar/scalar-mock-server

Versions

Its author publishes no version number, so there is nothing here to pin to: what you install is the folder as it stands today. Instructions change more often than APIs do — a skill can be rewritten entirely without anything it depends on moving.

v
  • No earlier releases have been published to the marketplace.
Pinning

Nothing to pin to: this skill carries no version number of its own. What you install is what the folder holds on the day you install it.

Reviews

no reviews yet · no installs yet

Nobody has reviewed this skill yet. The rating is the mean of the reviews written here, so there is none until somebody writes the first.

Who can post

Only accounts that have had the skill installed for fourteen days, so a review is written after living with it rather than after reading it. Publishers may reply once.

Who wrote it

SC
scalar

Publishes on mcprush.

0 servers listed2 skills listednot claimed
Profile
Publisher
Servers0