Open source · MIT · one binary
The chargeback arrives in 30 days. Or in 10 seconds.
TwinStub plays a third-party API back as a real HTTP server with memory: sessions, state, and chains of HMAC-signed webhooks with retries and a delivery journal. Run it in your terminal, in CI, or hand it to your coding agent.
$ go install github.com/twinstub/twinstub/cmd/twinstub@latest"The sandbox says: wait 30 days"
Chargebacks, KYC rejections and refunds can't be triggered on demand in most provider sandboxes. TwinStub moves a session's clock 30 days forward in one call and delivers everything due on the way.
"Your mock has no memory"
Real integrations are sequences: create, poll, webhook, poll again. A classic mock returns the same answer forever. TwinStub is a state machine with sessions, so the same GET says processing, then succeeded, then chargeback.
"Nobody tests webhooks honestly"
Signatures, retries, ordering, duplicates. TwinStub sends real HMAC-signed webhooks, delivers them in the order you choose, redelivers them, and breaks their signatures on purpose.
For coding agents
Your agent writes the handler. Now it can test it.
twinstub mcp gives an agent 13 tools: start a session, deliver completed before pending, redeliver an event, send a bad signature, move time 30 days forward, read what your app answered. The Claude Code plugin adds a skill that makes the agent write the expected end state first and check your app's state, not the 200s.

Other MCP clients run twinstub mcp directly. See the MCP docs.
How it works
Three steps, no framework
- 01
Describe the provider in YAML
States, replies, timed webhooks, signing. One file is the whole contract, and it lives in your repo.
- 02
Run it
twinstub servelocally or in CI, or let your agent start it throughtwinstub mcp. - 03
Point your code at the twin
Call it, receive signed webhooks, reorder and replay them, then assert your own state, not the acks.
What you actually test
Your code, on the events that break integrations
Inbound webhooks
Does your handler verify the signature, reject a forged one, and answer 2xx so the sender stops retrying?
Idempotency
The same event delivered twice must settle once. TwinStub redelivers under a new delivery id, or sends a byte-identical duplicate.
Out-of-order delivery
completed can arrive before pending. Deliver queued webhooks in exactly the order you want to test.
Delays and faults
A chargeback 30 days later, a retry after your handler returned 503, a stalled or dropped connection.
One honest limit: a twin is only as accurate as the scenario you write. Confirm the response shapes once against the provider's own sandbox, then use TwinStub for the edge cases the sandbox can't produce.
Honest comparison
Where TwinStub wins, and where it does not
| TwinStub | WireMock | Mockoon | Beeceptor | |
|---|---|---|---|---|
| Stateful scenario chains | yes, first-class | scenarios (flat states) | limited (rules) | no |
| Timed webhook chains | yes, with session clocks | per-request callbacks | partial (callbacks) | basic callbacks |
| HMAC-signed webhooks | yes | manual setup | no | no |
| Delivery journal and replay | yes | no | no | paid |
| Tools for coding agents | MCP server, Claude Code plugin | no | no | no |
| Single static binary | yes | JVM | Electron/CLI | SaaS |
| Record and proxy real traffic | no | yes, mature | yes | yes |
| GUI | no (by design) | third-party | yes, great | yes |
| Protocol coverage | HTTP/JSON | HTTP incl. multipart, XML | HTTP, WS, gRPC proxying | HTTP |
Need traffic recording, a GUI, or XML/SOAP matching? WireMock and Mockoon are better tools today. TwinStub's lane is deterministic, versionable simulation of event-driven APIs.
Get started
A single binary for macOS, Linux and Windows, or a Docker image. No account, no cloud.
$ go install github.com/twinstub/twinstub/cmd/twinstub@latestHosted sandboxes with a public URL and a live delivery journal: free beta coming soon.