cursorrules

A set of Cursor rules for mockd, a local server that pretends to be an API so software can be developed and tested before the real service is ready. It covers HTTP, GraphQL, gRPC, WebSocket, MQTT, SSE, and SOAP mocks, plus MCP setup.

In plain words
What is it for?
Use it to create fake API endpoints, generate stateful CRUD behavior, check mocks in continuous integration, or simulate failures such as outages.
Why use it?
It gives the coding agent the project’s mock-server commands, ports, and common patterns in one place. This reduces incorrect setup and makes tests less dependent on live services.

Cursor rule for Cursor

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add rules/getmockd/mockd/cursorrules
Clone the repo
git clone --depth 1 https://github.com/getmockd/mockd

Made for: Cursor.

Per session 803 This file is loaded in full into every session.
When invoked 803 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00803 $0.00803
Opus 5 $0.00402 $0.00402
Sonnet 5 $0.00161 $0.00161
Haiku 4.5 $0.00080 $0.00080

Measured yesterday against content hash 810ec6476405, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

cursorrules scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.cursorrules · 113 lines

How it starts

The opening of the file, as written. The whole thing — 113 lines — stays where its author put it; the contents beside it link to each section on GitHub.

mockd Rules for Cursor

Copy this file to .cursor/rules/mockd.md in your project root.

mockd Overview

mockd is a multi-protocol API mock server (HTTP, GraphQL, gRPC, WebSocket, MQTT, SSE, SOAP). It runs as a single binary with an admin API.

MCP Integration

mockd has an MCP server with 18 tools. Configure in .cursor/mcp.json:

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

The MCP server auto-starts a background daemon if no mockd server is running.

Ports

  • Mock server: 4280 (never use 8080)
  • Admin API: 4290 (never use 8081)

Common Patterns

Create a mock endpoint

mockd add http --path /api/users --status 200 --body '{"users":[]}'

Create CRUD endpoints (auto-generates GET, POST, PUT, DELETE)

mockd add http --path /api/users --stateful

Start with a config file

mockd start -c mocks.yaml

Verify mocks in CI

mockd verify check <mock-id> --exactly 3 || exit 1

Inject chaos for resilience testing

mockd chaos apply flaky    # 30% errors
mockd chaos apply offline  # 100% 503
mockd chaos disable

Config Format

mocks:
  - id: get-users
    type: http
    http:
      matcher:
        method: GET
        path: /api/users
      response:
        statusCode: 200
        body: '[{"id":"{{uuid}}","name":"{{faker.name}}"}]'

Template Functions

  • {{uuid}} — UUID v4
  • {{faker.name}}, {{faker.email}}, {{faker.phone}} — Identity
  • {{faker.creditCard}}, {{faker.iban}}, {{faker.price}} — Finance
  • {{now}}, {{timestamp}} — Time
  • {{request.Method}}, {{request.Path}} — Echo request
  • {{random.Int 1 100}} — Random numbers
  • {{faker.words(5)}} — Parameterized

Tables + Extend (Stateful Config)

The recommended way to add stateful CRUD to imported API specs in config files:

version: "1.0"
imports:
  - path: api-spec.yaml
    as: api
tables:
  - name: users
    idField: id
extend:
  - { mock: api.ListUsers, table: users, action: list }
  - { mock: api.CreateUser, table: users, action: create }
  - { mock: api.GetUser, table: users, action: get }

Read the full file on GitHub · 113 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 113 lines · 803 tokens per session scan A 810ec6476405

Subscribe to this mod's changes

cursorrules is a cursor rule published in the GitHub repository getmockd/mockd (144 stars, last pushed 13d ago), licensed Apache-2.0. It adds 803 tokens to every session, about $0.0040 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.