Skip to main content

mailsocket — MCP server

An MCP server that exposes mailsocket to AI coding agents as native tools, so an agent can create a throwaway inbox and block on the OTP or magic link without writing any polling code. It wraps the Python SDK — no second HTTP client, no re-implemented polling.

What it does

Tool What the agent gets
create_inbox(label?) a fresh inbox id + address
wait_for_otp(inbox_id, timeout?=60, min_confidence?=0) the headline — blocks (bounded, clamped to 120s requested deadline) and returns the OTP string + confidence + subject/from
wait_for_link(inbox_id, timeout?=60) the extracted magic link (returned, not followed)
list_inboxes(limit?, cursor?) one page of inboxes owned by the key (server default page size 25) + next_cursor/has_more
list_messages(inbox_id, has_otp?, subject_contains?, sender?, limit?, cursor?) one page of messages, optionally filtered (server default page size 25) + next_cursor/has_more
get_latest(inbox_id) the newest message, without blocking
delete_inbox(inbox_id) remove an inbox when done

Errors from the SDK (AuthError / NotFound / RateLimited / WaitTimeout) are turned into clean MCP tool errors — no stack traces, and the API key is never echoed back.

Requirements

  • Python 3.10+
  • A mailsocket API key — from the dashboard or POST /api/v1/agents/register.

Install

No install needed with uv:

uvx mailsocket-mcp

Or install with pip:

pip install mailsocket-mcp
mailsocket-mcp

Either way, it reads MAILSOCKET_API_KEY (and optional MAILSOCKET_BASE_URL) from the environment. If the key is missing it exits with a clear message and status 2; the key is never logged.

Register with an MCP client

Claude Desktop / Cursor

Add this to your client's MCP config file — claude_desktop_config.json for Claude Desktop, ~/.cursor/mcp.json for Cursor:

{
  "mcpServers": {
    "mailsocket": {
      "command": "uvx",
      "args": ["mailsocket-mcp"],
      "env": {
        "MAILSOCKET_API_KEY": "ms_live_..."
      }
    }
  }
}

Claude Code CLI

claude mcp add mailsocket -e MAILSOCKET_API_KEY=ms_live_... -- uvx mailsocket-mcp

Any other MCP-compatible client works the same way: point it at the mailsocket-mcp executable (or uvx mailsocket-mcp) over stdio and pass the key through the environment.

Env vars

Variable Required Description
MAILSOCKET_API_KEY yes (secret) Your mailsocket API key (ms_live_...).
MAILSOCKET_BASE_URL no Override the API base URL. Defaults to https://dash.mailsocket.app/api/v1.

Develop

pip install -e ".[dev]"
pytest

Tests are fully offline — the SDK client is faked, so nothing touches the live API.

Release files for mailsocket-mcp 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mailsocket-mcp 0.1.1
File Size Uploaded
mailsocket_mcp-0.1.1.tar.gz 12.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for mailsocket-mcp 0.1.1
File Interpreter ABI Platform
mailsocket_mcp-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 21.3 kB

Release files / mailsocket_mcp-0.1.1.tar.gz

Download URL mailsocket_mcp-0.1.1.tar.gz
Size 12.0 kB
Tags Source
SHA-256 checksum
How to use checksums
500e158f3365ba074fca795fb9564b7fd2ae58907f87b272194aeba19cf38a4c
BLAKE2b-256 checksum
How to use checksums
dc9f56379d79b545b0b456386d55373b0432ef3f833380894916a6ad1e00242c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.12

Release files / mailsocket_mcp-0.1.1-py3-none-any.whl

Download URL mailsocket_mcp-0.1.1-py3-none-any.whl
Size 9.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c5df3b3151d273e7c7b2dd3916a0521bd2e27ee39824becd7548a4d32690a33a
BLAKE2b-256 checksum
How to use checksums
a84975524982c906e606adae3f9f47bce7f30faad6afc481fb36177e585cf459
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.12

Release history Release notifications | RSS feed

0.2.1

2 release files

0.2.0

2 release files

This release

0.1.1 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page