Mock LLM Server — Testing skill for Claude Code
Fake OpenAI- and Anthropic-compatible API with scripted replies, tool calls, errors and streaming, for testing agents without API keys.
How to install Mock LLM Server
This entry records only its repository, not the path inside it, so there is no
exact command to give. Open acus9345/mock-llm-server and copy the folder into
~/.claude/skills/, or the file into ~/.claude/agents/.
What Mock LLM Server does
Fake OpenAI- and Anthropic-compatible API with scripted replies, tool calls, errors and streaming, for testing agents without API keys.
Alternatives in Testing
- Skill Debug — Debug issues methodically — use when stuck on errors, test failures, or unexpected behavior 2.8k ★
- Test TDD — Run when user calls /test-tdd 957 ★
- Robotics Agent Skills — Agent skills that make AI coding assistants write production-grade robotics software 170 ★
README
mock-llm-server
A fake OpenAI-, Anthropic- and Gemini-compatible API that returns scripted replies, tool calls, reasoning, errors and streams, so you can unit test agents without API keys. Zero dependencies.
[](https://www.npmjs.com/package/mock-llm-server) [](https://github.com/acus9345/mock-llm-server/actions/workflows/ci.yml) [](LICENSE)
- Real wire formats: OpenAI Chat Completions, Responses and Embeddings, Anthropic Messages and token counting, Gemini
generateContent, streaming, token counting and embeddings. Tested against the officialopenai,@anthropic-ai/sdkand@google/genaipackages, including their streaming helpers. - Streaming and tool calls: text arrives word by word over SSE, and tool-call arguments arrive in pieces, just like the real APIs.
- Reasoning: Anthropic thinking blocks, OpenAI reasoning summaries, Gemini thought parts and DeepSeek-style
reasoning_content. - Failures: HTTP errors in each provider's format, plus streams that break partway or drop the connection.
- Script it your way: a queue of replies, rules that match the user's message, or functions that see the whole request.
- Inspect what was sent: every request is recorded with its system prompt, flattened messages and tool names.
- Any language: run it as a CLI and script it over HTTP from Python, Go or anything else.
Install
npm install --save-dev mock-llm-server
Quick start
import OpenAI from "openai";
import { startMockLLM } from "mock-llm-server";
const mock = await startMockLLM();
const openai = new OpenAI({ baseURL: mock.openaiBaseURL, apiKey: "test" });
mock.reply("Paris is the capital of France.");
const res = await openai.chat.completions.create({
model: "gpt-5",
messages: [{ role: "user", content: "What is t
Related Skills
Turnpike
A minimal local gateway that proxies Claude/Anthropic and OpenAI-spec clients to any OpenAI- or Anthropic-comp
OpenAdapter
Self-hosted OpenAI API for Claude.ai via Playwright automation. No API key needed. Works with OpenClaw, Contin
FreeComputerUse
Local-first AI browser automation with Playwright. Use OpenAI, Grok, DeepSeek, Anthropic and compatible APIs—o
AI Gateway Testkit
Open-source conformance and regression testkit for Anthropic- and OpenAI-compatible AI gateways, with stable t
Prompt Regression
Snapshot & regression testing for LLM prompts in CI: YAML cases, pytest plugin + CLI, exact/regex/JSON-Schema/
AI Browserguard
A firewall for browser agents. Chrome extension that detects, monitors, and controls AI agents in your browser
Related Agents
Skeid Protocol Worker
Wire-protocol and service-integration worker — OpenAI/Anthropic/Ollama client formats, translation, SSE stream
LLM Integrator
LLM integration specialist who connects to OpenAI/Anthropic/Ollama APIs, designs prompt templates, implements
Grok Agent 01
ONLY job: find free or freemium AI token/API plans (OpenAI-compatible, Anthropic, Google, open routers, studen