specinbox-mcp
by arctronic
README.md
# specinbox-mcp
An [MCP](https://modelcontextprotocol.io) server that gives AI agents an email inbox. The agent creates a fresh address with one tool call, signs up or requests a code somewhere with it, then reads the message, the OTP and the links back. Built on the [Specinbox](https://specinbox.com) API; works in Claude Code, Claude Desktop, Cursor and any other MCP client.
Specinbox is a service of NANDBYTE LLC.
## Setup
You need a Specinbox API key from <https://specinbox.com/keys>. A `tm_test_` key is free and deterministic (see Test mode below); a `tm_live_` key creates inboxes that receive real mail. The key is read from the `SPECINBOX_API_KEY` environment variable only; it is never printed or logged.
Requires Node 18 or newer.
### Claude Code
```sh
claude mcp add specinbox -e SPECINBOX_API_KEY=tm_test_... -- npx -y specinbox-mcp
```
### Claude Desktop
Add to `claude_desktop_config.json` (Settings > Developer > Edit Config):
```json
{
"mcpServers": {
"specinbox": {
"command": "npx",
"args": ["-y", "specinbox-mcp"],
"env": { "SPECINBOX_API_KEY": "tm_test_..." }
}
}
}
```
### Cursor
Add to `.cursor/mcp.json` in the project (or `~/.cursor/mcp.json` globally):
```json
{
"mcpServers": {
"specinbox": {
"command": "npx",
"args": ["-y", "specinbox-mcp"],
"env": { "SPECINBOX_API_KEY": "tm_test_..." }
}
}
}
```
### Environment variables
| Variable | Required | Meaning |
|---|---|---|
| `SPECINBOX_API_KEY` | yes | `tm_live_...` or `tm_test_...`. The server exits with a clear message when it is missing. |
| `SPECINBOX_API_URL` | no | API base URL, default `https://devapi.temp-mail.lol`. |
## Tools
| Tool | Input | Returns |
|---|---|---|
| `create_inbox` | `expires_in?` (60 to 2592000 s), `domain?`, `local_part?` (own custom domain only) | `id` (`inb_...`), `address`, `domain`, `livemode`, `status`, `created_at`, `expires_at`; a `note` about the fixture message in test mode |
| `list_messages` | `inbox_id`, `limit?` (1 to 100), `since?` (ISO 8601), `cursor?` | `messages[]` with `id`, `from`, `to`, `subject`, `received_at`, `size`, `attachment_count`; `has_more`, `next_cursor` |
| `get_message` | `message_id` (`msg_...`) | `text` (HTML converted when no text part; cut at 20,000 chars with `text_truncated`), `html_length`, `otp_codes[]` (4 to 8 digit codes, subject first, text and HTML), `links[]`, `attachments[]`, `from`, `to`, `subject`, `date`, `truncated`, `loopback` |
| `wait_for_message` | `inbox_id`, `subject_contains?`, `from_contains?`, `since?`, `timeout_seconds?` (default 60, max 300) | `{found: true, waited_seconds, message}` with the same enriched message as `get_message`, or `{found: false, waited_seconds, polls, message}` after the timeout. Never throws on timeout. |
| `delete_inbox` | `inbox_id` | `{deleted: true, inbox_id}` |
`wait_for_message` polls every 2 seconds and, when the API answers 429 `rate_limited`, waits for its `Retry-After` before trying again; a `quota_exceeded` 429 or three server errors in a row stop the wait and surface as a tool error. API errors come back as readable tool errors: `unauthenticated` points at the key, `rate_limited` and `quota_exceeded` include the retry time, `limit_reached` suggests `delete_inbox`.
## Example agent prompt
> Sign up on https://staging.example.com with a new Specinbox address, then read the OTP from the inbox and finish the signup.
A typical run: `create_inbox` gives `k3v9pq7m2a1z8xoc@temp-mail.lol`; the agent fills the form with it; `wait_for_message` with `subject_contains: "code"` returns the mail with `otp_codes: ["731942"]`; the agent types the code; `delete_inbox` cleans up.
## Test mode
With a `tm_test_` key every inbox is a sandbox inbox that nothing outside can email. It is created already holding one fixture message, `Your verification code is 424242` from `Specinbox Fixtures <fixtures@sandbox.temp-mail.lol>`, so `wait_for_message` returns at once with `otp_codes: ["424242"]`. Use it to wire up and test an agent without sending real mail, and pass `since` to skip the fixture when you inject your own messages with `POST /v1/test/inboxes/{inbox_id}/messages`.
## Develop
```sh
npm install
npm run build # tsc -> dist/
npm test # vitest, mocked HTTP only
SPECINBOX_API_KEY=tm_test_... node dist/index.js # run the server on stdio
npx @modelcontextprotocol/inspector node dist/index.js # poke the tools interactively
```
Commit messages are one line, at most 80 characters, no trailers: `git config core.hooksPath .githooks` once per clone.
## Links
- Docs: <https://specinbox.com/docs/mcp>
- API reference and OpenAPI spec: <https://specinbox.com/docs/api>
- Support: contact@tronics.dev
MIT License. Specinbox is a service of NANDBYTE LLC.
This server cannot be deployed
Maintenance
ActivityMaintained
ResponsivenessNo recent community issues