Skip to content

AI Agent Setup

mockd ships with agent configuration templates that teach AI assistants how to use mockd effectively. These templates provide your AI editor with the correct ports, commands, config syntax, and patterns — so you can say “create an API mock” and it just works.

AI assistants like Claude Code, Cursor, and GitHub Copilot read project-level instruction files to understand your tools and conventions. Without a mockd config, the AI might:

  • Use port 8080 instead of 4280
  • Generate invalid mock configs
  • Miss useful features like --stateful, chaos profiles, or verification

With a config file, the AI knows mockd’s full capabilities and generates correct commands on the first try.

Copy CLAUDE.md to your project:

Terminal window
mkdir -p .claude
curl -sSL https://raw.githubusercontent.com/getmockd/mockd/main/contrib/agent-configs/CLAUDE.md \
-o .claude/mockd.md

Claude Code reads all .md files in .claude/ automatically.

Copy cursor-rules.md to your project:

Terminal window
mkdir -p .cursor/rules
curl -sSL https://raw.githubusercontent.com/getmockd/mockd/main/contrib/agent-configs/cursor-rules.md \
-o .cursor/rules/mockd.md

Cursor reads all .md files in .cursor/rules/ automatically.

Append the mockd instructions to your Copilot config:

Terminal window
curl -sSL https://raw.githubusercontent.com/getmockd/mockd/main/contrib/agent-configs/copilot-instructions.md \
>> .github/copilot-instructions.md

For the best experience, combine an agent config template with the MCP server. The config template teaches the AI about mockd concepts and syntax, while MCP gives it direct tool access to create and manage mocks without running CLI commands.

Claude Code — Add MCP + config:

{
"mcpServers": {
"mockd": {
"command": "mockd",
"args": ["mcp"]
}
}
}

Plus .claude/mockd.md in your project root.

Cursor — Add MCP + rules:

.cursor/mcp.json:

{
"mcpServers": {
"mockd": {
"command": "mockd",
"args": ["mcp"]
}
}
}

Plus .cursor/rules/mockd.md in your project root.

Each template includes:

SectionPurpose
PortsCorrect defaults: 4280 (mock), 4290 (admin)
CLI ReferenceCreate, list, delete, import, export, verify, chaos commands
Config FormatValid YAML structure with type + protocol wrapper
Template Functions35 faker types (case-insensitive), UUID, timestamps, request echo, random values
Matching RulesPath patterns, header globs, body matchers
MCP ToolsAll 18 tools with action parameters

The templates are starting points. You can customize them for your project:

## Project-Specific Mocks
This project mocks the Payment API (Stripe-like):
- Base path: /api/v1/payments
- Auth: Bearer token in Authorization header
- Always return idempotency-key in response headers
When creating payment mocks, use:
- faker.creditCard for card numbers (Luhn-valid)
- faker.currencyCode for currencies (ISO 4217)
- faker.price for amounts

All templates live in the mockd repository:

mockd/contrib/agent-configs/
CLAUDE.md # Claude Code / Claude Desktop
cursor-rules.md # Cursor
copilot-instructions.md # GitHub Copilot

Browse them on GitHub: github.com/getmockd/mockd/tree/main/contrib/agent-configs