Twinning
Every API has two contracts: the one it publishes and the one it actually keeps. Twinning is an open-source Rust tool that makes a contract runnable. Point it at an OpenAPI document or a schema and it serves a local twin with the same routes, auth shape, and response schemas, with no backend behind it. Agents and test suites develop against the twin instead of production, so nothing live is touched and no quota is spent.
A twin is not a hand-written mock. It speaks REST, the Postgres wire protocol, the Snowflake wire protocol, and MCP, and it can overlay measured live behavior on top of a published spec so the quirks your code will meet in production show up in testing.
Set it up with an agent
The fastest install is to hand your coding agent the prompt in the README. It detects your OS, downloads the latest release, verifies the checksum, runs the health check, and registers the MCP server with your client. The full, current prompt lives in the repository. The short version:
Install twinning from its latest GitHub release, verify it, and register its MCP server with this client. Run twinning-mcp doctor and confirm it reports healthy before you finish.
What it is for
Teams building agents and data pipelines need somewhere safe to be wrong. A twin gives an agent a place to try destructive calls, malformed requests, and pagination edge cases, and gives your test suite deterministic responses that match recorded live behavior byte for byte.
Background reading: Every API has two contracts.
Work with us
Twinning is MIT licensed and free to use. If you want twins built for your own APIs and databases, or want help wiring them into an agent workflow, start a conversation.
Support
Questions, bugs, or trouble with setup: email cairn@cmdrvl.com, or open an issue on GitHub.