scalar-mock-server
Skill by scalar
Builds, customizes, and troubleshoots OpenAPI mock servers with @scalar/mock-server. It is for developers who need realistic API responses from an OpenAPI description.
Install scalar-mock-server
Built from the published package, never by AI.
git clone --depth 1 https://github.com/scalar/scalar /tmp/scalar && mkdir -p ~/.claude/skills && cp -r /tmp/scalar/.agents/skills/scalar-mock-server ~/.claude/skills/scalar-mock-serverRun in your terminal. Claude Code loads skills from ~/.claude/skills automatically.
git clone --depth 1 https://github.com/scalar/scalar /tmp/scalar && mkdir -p ~/.gemini/antigravity-cli/skills && cp -r /tmp/scalar/.agents/skills/scalar-mock-server ~/.gemini/antigravity-cli/skills/scalar-mock-serverAntigravity CLI loads skills from ~/.gemini/antigravity-cli/skills, or .agents/skills for one project.
Skills can run scripts on your machine. Some need an API key: check the README.
About
The scalar-mock-server skill is a reference for implementing and debugging mock APIs with the @scalar/mock-server package. It covers creating a mock server from an OpenAPI description document, which can be a URL, file path, or object, using the createMockServer() function. The skill also explains how to add custom request behavior with x-handler, seed data with x-seed, and run the server in Docker.
When the server starts, it loads the description document, seeds data from x-seed extensions, registers authentication routes for declared security schemes, and registers a route for each path and method. It also exposes the source document at /openapi.json and /openapi.yaml. The skill is aimed at developers who want realistic responses from an API description, along with custom logic or Docker-based mock environments.
Written from the project's SKILL.md and checked against it.
What it can do
- Create a mock serverRuns a mock server from an OpenAPI description with createMockServer() or the Scalar CLI.
- Custom request handlersUses x-handler to add dynamic behavior in place of static examples.
- Seed dataUses x-seed on schemas to load initial collection data at startup.
- Authentication routesRegisters authentication routes for the security schemes declared in the document.
- Request validationReturns 422 for contract violations by default, and can be turned off.
- Docker setupRuns the scalarapi/mock-server image with a document URL or mounted files.
- TroubleshootingLists checks for missing seed data, auth failures, and handler errors.
What you need
- Node.js 22 or later
- An OpenAPI description document
- Docker, for the Docker setup
Try asking
- Create a mock server from my openapi.yaml file and watch for changes
- Add an x-handler to my POST /orders operation that returns a 201
- Seed my Users schema with 20 faker-generated items using x-seed
Good to know
- Store data is in memory.
- The document option specification is deprecated in favor of document.
- Request validation is on by default and must be turned off to get mock responses for contract violations.
Security check
ANo download-and-run commands, hidden instructions or signs of sending keys out were found.
Checked automatically: .agents/skills/scalar-mock-server/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work
Inside the skill
-
SKILL.md5 KB
Alternatives to scalar-mock-server
All alternatives →Runs a 7-stage workflow for auditing, cleaning up and reviewing GitHub repositories, plus competitor analysis. Written for developers who want a repo checked for secrets, junk files and documentation gaps.
Teaches an AI assistant to build, debug and explain Gradio web UIs and ML demos in Python. It covers the core API, components, event listeners, layouts and the MCP server option. Aimed at Python developers who work with Gradio.
Recommends menus, buttons, toolbars and disclosure controls for Apple platforms using Human Interface Guidelines conventions. Built for developers and designers making iOS, iPadOS, macOS or visionOS interfaces. Checks existing project design context before asking questions.
Creates production-ready FastAPI project structures with async patterns, dependency injection, and error handling. It is for developers starting new FastAPI applications or backend API projects.
Analyzes Android apps to find user workflows to expose as AppFunctions, so AI agents and system shortcuts can run them without opening the app UI. Generates Kotlin code and refines KDoc for Android developers.
Creates, edits, validates and runs Agent QA tests, suites and hooks through MCP or CLI. It keeps canonical IDs and schema contracts intact, for developers and QA teams using Agent QA.
Compare with openclaw-github-repo-commander, gradio or hig-components-menus
scalar-mock-server: common questions
What runtime does @scalar/mock-server need?
The package lists Node.js as its runtime, with an engine requirement of version 22 or higher.
How do I seed data for a mock server?
Use x-seed on components.schemas entries. The schema key name is used as the collection name, and seeding happens only when the collection is empty at startup.
What happens when a custom handler fails?
The mock server returns a 500 response with handler error details, which the skill says to inspect when troubleshooting.
How do I install scalar-mock-server?
Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.
Is scalar-mock-server free?
The code is published under the MIT licence. The service it connects to may have its own pricing.
Is scalar-mock-server safe to use?
It scores 86 of 100. Grades: maintenance A, licence A, quality A. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.
What are alternatives to scalar-mock-server?
Similar skills: openclaw-github-repo-commander, gradio, hig-components-menus, fastapi-templates.
