mockd Samples

March 17, 2026 · View on GitHub

Real-world examples of mockd's digital twin and API mocking capabilities.

Available Samples

Digital Twins (Third-Party APIs)

SampleDescriptionStatefulEndpointsSDK Tested
Stripe APIFull Stripe payment API digital twin9 tables, 46 bindings, 8 custom ops587stripe-go 49/49
Twilio APITwilio REST API v2010 digital twin7 tables, 32 bindings197twilio-go 13/13
OpenAI APIOpenAI API with stateful models + assistants3 tables, 11 bindings237openai Python SDK

Use Case Samples

SampleDescriptionWhat it shows
MCP WorkflowBuild a Todo API with AI tool callsCreate mocks via MCP — zero CLI commands
GitHub ActionsContract testing in CIsetup-mockd action + mockd verify
Docker ComposeMock dependent microservicesUser + Payment service mocks for local dev

Quick Start

Every sample follows the same pattern:

cd third-party-apis/stripe-api
mockd start -c mockd.yaml --no-auth

Or with Docker:

docker compose up

The mock server runs on localhost:4280 by default.

Digital Twin Architecture

The Stripe and Twilio samples are digital twins — stateful mocks that behave like the real API:

  • Tables define in-memory resource collections (customers, invoices, messages, etc.)
  • Extend bindings wire HTTP endpoints to CRUD operations on those tables
  • Custom operations handle domain logic (e.g., paying an invoice, sending a message)
  • Imports split large configs into composable files

This means POST /v1/customers actually creates a customer that GET /v1/customers/:id can retrieve — no scripting required.

Requirements

  • mockd v0.6.0+