-
Notifications
You must be signed in to change notification settings - Fork 71
Ai crawl fixes #412
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Ai crawl fixes #412
Changes from 2 commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,203 @@ | ||
| --- | ||
| title: "AI for WireMock" | ||
| --- | ||
|
|
||
| import CloudCallout from '../../../../components/CloudCallout.astro'; | ||
|
|
||
| <CloudCallout title="WireMock Cloud AI" icon="star"> | ||
| WireMock Cloud has native AI integration via the Model Context Protocol (MCP). Agents can create, manage, record, and validate mock APIs directly from your editor or terminal. | ||
| [**Learn more →**](https://docs.wiremock.io/ai-mcp/ai-101?utm_source=oss-docs&utm_medium=oss-docs&utm_campaign=ai-solutions-page) | ||
| </CloudCallout> | ||
|
|
||
| ## Using AI with WireMock OSS | ||
|
|
||
| WireMock OSS is extensively documented and well-represented in AI model training data. Tools like Claude, GitHub Copilot, and Cursor have working knowledge of WireMock's stub format, request matching DSL, response templating syntax, and Java API without any additional setup. | ||
|
|
||
| The most effective workflow is pointing an AI assistant at your codebase and asking it to generate stubs for your external dependencies in a single pass. A capable model can identify your HTTP clients, infer request and response shapes, and produce ready-to-use stub mappings directly. | ||
|
|
||
| **Example prompt:** | ||
| ``` | ||
| Scan this repository and generate WireMock 3.x JSON stub mappings for all | ||
| outbound HTTP calls. Use request matching on method and URL. Where response | ||
| bodies can be inferred from usage, include them. | ||
| ``` | ||
|
|
||
| **Example output:** | ||
| ```json | ||
| { | ||
| "mappings": [ | ||
| { | ||
| "request": { | ||
| "method": "GET", | ||
| "urlPathPattern": "/api/users/\\d+" | ||
| }, | ||
| "response": { | ||
| "status": 200, | ||
| "headers": { "Content-Type": "application/json" }, | ||
| "jsonBody": { | ||
| "id": 1, | ||
| "name": "Test User", | ||
| "email": "user@example.com", | ||
| "createdAt": "2024-01-01T00:00:00Z" | ||
| } | ||
| } | ||
| }, | ||
| { | ||
| "request": { | ||
| "method": "POST", | ||
| "urlPath": "/api/orders" | ||
| }, | ||
| "response": { | ||
| "status": 201, | ||
| "headers": { "Content-Type": "application/json" }, | ||
| "jsonBody": { | ||
| "orderId": "ord_abc123", | ||
| "status": "created" | ||
| } | ||
| } | ||
| }, | ||
| { | ||
| "request": { | ||
| "method": "GET", | ||
| "urlPath": "/api/products", | ||
| "queryParameters": { | ||
| "category": { "anything": true } | ||
| } | ||
| }, | ||
| "response": { | ||
| "status": 200, | ||
| "headers": { "Content-Type": "application/json" }, | ||
| "jsonBody": { | ||
| "items": [], | ||
| "total": 0 | ||
| } | ||
| } | ||
| } | ||
| ] | ||
| } | ||
| ``` | ||
|
|
||
| AI assistants also work well for: | ||
|
ethangj marked this conversation as resolved.
Outdated
|
||
|
|
||
| - Generating stubs from an OpenAPI or Swagger spec | ||
| - Writing [response templates](../../response-templating/) with Handlebars helpers | ||
| - Building [stateful scenarios](../../stateful-behaviour/) from a description of the state machine | ||
| - Bulk-converting static stubs to use response templating | ||
| - Explaining or documenting existing stub configurations | ||
|
|
||
| **Tips:** | ||
| - Specify the WireMock version (2.x vs 3.x) — templating helpers and some syntax differ | ||
| - Include existing stub examples as context so the model matches your conventions | ||
| - For `matchesJsonPath` and `matchesXPath` matchers, always validate the generated expressions against real requests | ||
|
|
||
| ## WireMock Cloud AI | ||
|
|
||
| WireMock Cloud is built for AI-assisted workflows. Agents can create, manage, record, and validate mock APIs as native tool calls — without leaving your editor or terminal. This works through two complementary layers: an MCP server that gives any compatible AI tool direct API access, and a library of agent skills that package common workflows into single invocable commands. | ||
|
|
||
| Full documentation: [WireMock Cloud AI overview →](https://docs.wiremock.io/ai-mcp/ai-101?utm_source=oss-docs&utm_medium=oss-docs&utm_campaign=ai-solutions-page) | ||
|
|
||
| **Supported tools:** Claude Code, Claude Desktop, Cursor, VS Code + GitHub Copilot, Windsurf, Augment | ||
|
|
||
| ### Installation | ||
|
|
||
| **1. Install the WireMock CLI** | ||
|
|
||
| ```bash | ||
| npm i -g @wiremock/cli | ||
| ``` | ||
|
|
||
| **2. Authenticate** | ||
|
|
||
| ```bash | ||
| wiremock login | ||
| ``` | ||
|
|
||
| **3. Configure your AI tool** | ||
|
|
||
| Claude Code: | ||
| ```bash | ||
| claude mcp add wiremock -- wiremock mcp | ||
| ``` | ||
|
|
||
| VS Code (`settings.json`): | ||
| ```json | ||
| { | ||
| "mcp": { | ||
| "servers": { | ||
| "WireMock": { | ||
| "type": "stdio", | ||
| "command": "wiremock", | ||
| "args": ["mcp"] | ||
| } | ||
| } | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| Claude Desktop and Windsurf: | ||
| ```json | ||
| { | ||
| "mcpServers": { | ||
| "wiremock": { | ||
| "command": "wiremock", | ||
| "args": ["mcp"] | ||
| } | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| Verify by asking your agent: *"Am I logged into WireMock Cloud?"* | ||
|
|
||
| - [Full installation guide](https://docs.wiremock.io/ai-mcp/installation?utm_source=oss-docs&utm_medium=oss-docs&utm_campaign=ai-solutions-page) | ||
|
|
||
| ### Agent skills | ||
|
|
||
| Pre-built multi-step workflows the agent can invoke by name. Install all seven in Claude Code with: | ||
|
|
||
| ```bash | ||
| claude plugin marketplace add wiremock-inc/skills | ||
| claude plugin install wiremock-cloud@wiremock-inc-skills | ||
| ``` | ||
|
|
||
| Or from within a Claude Code session: | ||
|
|
||
| ``` | ||
| /plugin marketplace add wiremock-inc/skills | ||
| /plugin install wiremock-cloud@wiremock-inc-skills | ||
| ``` | ||
|
|
||
| Verify with: `What skills are available?` — then invoke with e.g. `/build-api-simulation`. | ||
|
|
||
| | Skill | What it does | | ||
| |-------|-------------| | ||
| | **Build API Simulation** | Generates a complete mock API from a description, OpenAPI spec, or codebase — stubs and spec included | | ||
| | **Create Stubs** | Creates and imports stub mappings into a mock API | | ||
| | **Convert to Stateful** | Transforms stubs to use the key-value state store | | ||
| | **Convert to Data-Driven** | Adapts stubs to serve responses from CSV or database sources | | ||
| | **Validate and Fix Stubs** | Checks stubs against an OpenAPI schema and patches mismatches | | ||
| | **Author Response Templates** | Writes and debugs Handlebars response templates | | ||
| | **Search Documentation** | Looks up WireMock Cloud documentation within the conversation | | ||
|
|
||
| - [Agent skills reference](https://docs.wiremock.io/ai-mcp/agent-skills?utm_source=oss-docs&utm_medium=oss-docs&utm_campaign=ai-solutions-page) | ||
|
|
||
| ### MCP tools | ||
|
|
||
| The MCP server exposes granular tools for direct API access: | ||
|
|
||
| - **Mock API management** — create, search, clear, and delete mock APIs | ||
| - **Stub management** — import, retrieve, update, and delete stub mappings | ||
| - **API specifications** — fetch and push OpenAPI and GraphQL schema documents | ||
| - **Recording** — start a session against a live service, capture traffic, stop to produce stubs | ||
| - **Request journal** — query and reset logged requests | ||
| - **Data sources** — manage CSV and database sources backing data-driven stubs | ||
| - **HTTP client** — make authenticated HTTP calls from within the agent context | ||
|
|
||
| - [MCP tools reference](https://docs.wiremock.io/ai-mcp/mcp-tools?utm_source=oss-docs&utm_medium=oss-docs&utm_campaign=ai-solutions-page) | ||
|
|
||
| ## Useful pages | ||
|
|
||
| - [Stubbing](../../stubbing/) | ||
| - [Response Templating](../../response-templating/) | ||
| - [Stateful Behaviour](../../stateful-behaviour/) | ||
| - [Record and Playback](../../record-playback/) | ||
| - [WireMock Cloud](../../wiremock-cloud/) | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.