Create a safe destination
Give this run its own inbox.
Use a stable run ID such as ci-4182. Parallel tests stay separate and cleanup can target the whole run.
signup.ci-4182@inbox.acme.testAgent runtime and MCP
Your agent asks for the message it needs. InboxSpec waits on the server, then returns the code, link, and useful context in one result.
No polling loop. Waiting is not metered or rate limited.
wait_for_message60s maxThe response is the artifact. The next agent step can use it immediately.
Connect to hosted InboxSpec with REST examples for JavaScript, Python, Java and more. SDK and CLI require access to our private release. Connect your agent with hosted MCP and a project key. Choose a connection method.
You supply a run identifier and the message you expect. The response gives your agent a next action, not another search task.
Create a safe destination
Use a stable run ID such as ci-4182. Parallel tests stay separate and cleanup can target the whole run.
signup.ci-4182@inbox.acme.testTrigger your product
Sign up, reset a password, invite a teammate, or run any flow that sends inbound email.
Block on the result
Match the subject, require a code, or look for a verification link. One call returns as soon as the right message arrives.
message.codes[0] → 482913Use your interface
MCP is a first-class interface over the same core as REST, SDK, and CLI. Switching tools does not change the match rules or outcomes.
wait_for_message({
inbox: "signup.ci-4182@inbox.acme.test",
match: { subject_contains: "verify", has_code: true },
timeout_ms: 60000
})POST /v1/messages/wait
{
"inbox": "signup.ci-4182@inbox.acme.test",
"match": { "subject_contains": "verify", "has_code": true },
"timeout_ms": 60000
}const result = await inboxspec.messages.wait({
inbox: inbox.address,
match: { subject_contains: "verify", has_code: true },
timeout_ms: 60_000,
});inboxspec wait \
--inbox signup.ci-4182@inbox.acme.test \
--subject-contains verify \
--has-code \
--timeout 60Predictable outcomes
A timeout is a useful result. A wrong inbox, spent quota, or invalid request is a typed error. Your agent can choose a repair instead of guessing and retrying forever.
Token-bounded by design
InboxSpec puts the useful preview in the response and gives the complete body its own URL. The agent asks for more only when the task needs it.
truncated: truetotal_bytes: 18240url: /body?format=textStart with one real flow
Use hosted MCP with your project key to create an inbox and wait for mail from your agent. REST, SDK and CLI are also available. Follow the setup guide before using these illustrative fragments.
Save your project key and choose a supported client from the setup guide.
Use a name your logs and agent can recognize.
Branch on matched or timeout. Both explain what happened.