Skip to content

Guide · Agent skill

How to use the WireMock Mock Server Control agent skill

Updated · written with AI from the project's own documentation and checked against our catalogue data

The cli-anything-wiremock skill teaches an AI agent to control a WireMock server, a tool that stands in for a real web API during testing. Once installed, the agent can create fake API responses, check which requests your system under test sent, switch stateful test scenarios and record traffic from a real backend. This guide covers what the skill does, how to install it, how to ask for it, and the safety points to check before you run it.

WireMock Mock Server ControlHKUDS/CLI-Anything · Apache-2.0

Quick start

  1. 1Download and unzip the skill. Download the ZIP from this page and unzip it so the SKILL.md file sits in a cli-anything-wiremock skill folder under ~/.claude/skills/ or a project's .claude/skills/.
  2. 2Install the Python package. Install the cli-anything-wiremock Python package. The source does not show the install method, so follow the project's own instructions.
  3. 3Start WireMock. Run a WireMock server and confirm its admin API is available at /__admin/.
  4. 4Set connection variables. Export WIREMOCK_HOST and WIREMOCK_PORT so the program knows where to connect.
  5. 5Check connectivity. Run cli-anything-wiremock status to confirm WireMock is running and reachable.
  6. 6Ask the agent for a test setup. Describe the endpoints to mock and what to verify, and the agent will create stubs and run request counts.
  7. 7Clean up. Run cli-anything-wiremock reset after the test run so stubs and requests do not carry over.

What the skill lets the agent do

The skill wraps WireMock's Admin REST API, which is served under /__admin/. It runs a command-line program called cli-anything-wiremock, and the agent calls that program to manage the server. The commands fall into five groups: stub for managing HTTP stub mappings, request for inspecting served requests, scenario for stateful scenarios, record for capturing traffic from a real backend, and settings for global server settings. There are also top-level commands for status, reset and shutdown.

  • Create, list, fetch, delete, reset, save and import stubs
  • List recent requests, find or count requests matching a JSON pattern, and list unmatched requests (404s)
  • List, set and reset stateful scenarios
  • Start, stop and check recording, or snapshot in-memory requests as stubs

Install the skill from a ZIP file

Download the ZIP for this skill from this page and unzip it. The skill is a folder containing a SKILL.md file. To make it available to all your projects, unzip it into ~/.claude/skills/. To limit it to one project, unzip it into that project's .claude/skills/ folder.

In the Claude apps you can instead upload the ZIP under Settings → Capabilities → Skills.

  • Personal install: ~/.claude/skills/
  • Project install: .claude/skills/ inside your project

Install the command-line program and connect to WireMock

The skill needs the Python cli-anything-wiremock package installed, but the source file does not say how to install it, so check the project's documentation for the install method. You also need a running WireMock server with its admin API available at /__admin/.

Tell the program where WireMock is by setting two environment variables before any command runs. The agent can then call the status command to confirm the connection.

  • Required: Python with the cli-anything-wiremock package
  • Required: a running WireMock server, with admin API at /__admin/
  • Set WIREMOCK_HOST (for example localhost) and WIREMOCK_PORT (for example 8080)
export WIREMOCK_HOST=localhost export WIREMOCK_PORT=8080 cli-anything-wiremock status

Ask for it in natural language

You do not need to type commands yourself. Describe the test situation and the agent should pick the matching commands. Name the endpoint, the method and the response you want, and say what you want checked. For example, you might ask the agent to mock a payment endpoint to return success, run your tests, then confirm the endpoint was called exactly once.

The skill's own workflow is: set up stubs before the system under test runs, run it, verify interactions with request count, then reset WireMock to clean up. Asking for these steps in order gives the agent a clear plan.

  • "Mock POST /api/payment to return 200 with success true, then check it was called once."
  • "Set the cart-flow scenario to item-added before the next test step."
  • "Record traffic from https://api.example.com and turn it into stubs."

Examples of the commands the agent runs

Quick form creates a stub from method, URL and status code, with an optional body. The full JSON form gives you control over the request and response. Adding --json makes output machine-readable, which is the mode the skill's guidance recommends for agent use.

To verify a call, the agent counts requests matching a pattern. The source shows a count of 1 returned as {"count": 1} for a POST to /api/orders.

cli-anything-wiremock stub quick GET /api/users 200 --body '[{"id":1}]' cli-anything-wiremock stub create '{ "request": {"method": "POST", "url": "/api/orders"}, "response": {"status": 201, "body": "{\"id\":99}"} }' cli-anything-wiremock --json request count '{"method":"POST","url":"/api/orders"}' # → {"count": 1} cli-anything-wiremock scenario set "cart-flow" "item-added" cli-anything-wiremock record start https://api.example.com cli-anything-wiremock record stop

Safety: scripts, network and recorded data

This skill runs scripts and uses the network. It administers a mock server, and the reset and shutdown commands can clear state or stop the server. Do not point it at a live environment, because that could disrupt real traffic. Use it only against a test WireMock instance.

Recording captures real requests and responses through a proxy. Before recording a real backend, check what gets captured, since it may include secrets or personal data. Clean up recorded stubs you do not need.

  • Only target a test WireMock instance, never a production system
  • reset and shutdown change server state; run them deliberately
  • Review recorded traffic for secrets or personal data before keeping it

Tips for reliable results

Agents should always pass --json in scripts and tool calls. The source notes that data commands return raw WireMock API JSON, void commands return {"status": "ok"}, and errors return {"status": "error", "message": "..."} with a non-zero exit code.

Reset state at the end of each run so stubs from one test do not leak into the next. Use request unmatched to find calls that no stub handled, which often points to a missing or misspelled stub.

  • Always use --json in agent contexts
  • Check the exit code and the status field to detect failures
  • Run reset between test runs
  • Use request unmatched to debug 404s

What people use it for

  • Mock a payment API so an integration test gets a fixed success response
  • Check that an application called an order endpoint exactly once
  • Switch a stateful scenario to test a multi-step cart flow
  • Record traffic from a real backend and reuse it as stubs in tests
  • Find requests that matched no stub to spot missing mocks

Frequently asked questions

What is the cli-anything-wiremock skill?

It is an agent skill that teaches an AI agent to drive a WireMock mock server through a Python command-line program called cli-anything-wiremock. The agent uses it to set up fake API responses, inspect requests and manage scenarios during testing.

How do I install the WireMock agent skill?

Download the ZIP from this page and unzip it into ~/.claude/skills/ for all projects or into a project's .claude/skills/ folder for one project. You can also upload the ZIP in the Claude apps under Settings → Capabilities → Skills.

What do I need to run it?

You need Python with the cli-anything-wiremock package installed, a running WireMock server, and its admin API available at /__admin/. Set WIREMOCK_HOST and WIREMOCK_PORT to point the program at your server. The source does not show how to install the package, so check the project's documentation.

Is it safe to use on a production server?

No. The tool administers a mock server and can reset or shut it down, so pointing it at a live environment could disrupt real traffic. Use it only against a test WireMock instance.

Can it record real API traffic?

Yes. The record commands proxy and capture traffic from a real backend and can turn it into stubs. Check the captured data first, because recorded requests and responses may include secrets or personal data.

What should I use instead if I am not running WireMock?

This skill only works with WireMock's admin API, so it does not help with other mock tools. The source does not compare it with other options, so choose a tool that matches your existing test setup.

New agent skills, repos and AI tools — every week

The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.

Our verdict

This skill suits developers and QA engineers who run WireMock in integration tests and want an agent to set up stubs, verify request counts and clean up between runs. It is not suitable for production or live environments, and it is a poor fit if you do not run WireMock at all.

Download the skill