MCP Server

Give AI agents an inbox. Install the OneShotMail MCP server for Claude Desktop, Cursor, Windsurf, and other MCP clients.

Overview

The OneShotMail MCP (Model Context Protocol) server lets AI agents create disposable email addresses, send emails, and check inboxes as part of agentic workflows. It exposes six tools that an AI agent can use:

ToolDescription
oneshot_create_addressCreate a temporary email address to receive one email.
oneshot_send_emailSend a one-shot email from a temporary address.
oneshot_check_emailCheck if an email has been received.
oneshot_wait_for_emailWait for an email to arrive (polls with backoff).
oneshot_delete_addressDelete an address and its email.
oneshot_list_addressesList recent addresses.

Installation

pip install oneshot-mcp

Or install from source:

git clone https://github.com/BarkingIguana/oneshot.git
cd oneshot/mcp
pip install -e .

Configuration

The MCP server requires one environment variable:

export ONESHOT_API_KEY="osm_live_your_key"

Optionally set a custom API base URL:

export ONESHOT_BASE_URL="https://api.oneshotemail.com/v1"

Claude Desktop

Add the following to your Claude Desktop configuration file:

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json Windows: %APPDATA%\Claude\claude_desktop_config.json

{
  "mcpServers": {
    "oneshot-mail": {
      "command": "oneshot-mcp",
      "env": {
        "ONESHOT_API_KEY": "osm_live_your_key"
      }
    }
  }
}

If oneshot-mcp is not on your PATH, use the full path:

{
  "mcpServers": {
    "oneshot-mail": {
      "command": "/usr/local/bin/oneshot-mcp",
      "env": {
        "ONESHOT_API_KEY": "osm_live_your_key"
      }
    }
  }
}

Restart Claude Desktop after making changes.


Cursor

Add to your Cursor MCP settings (.cursor/mcp.json or Cursor Settings > MCP):

{
  "mcpServers": {
    "oneshot-mail": {
      "command": "oneshot-mcp",
      "env": {
        "ONESHOT_API_KEY": "osm_live_your_key"
      }
    }
  }
}

Windsurf

Add to your Windsurf MCP configuration:

{
  "mcpServers": {
    "oneshot-mail": {
      "command": "oneshot-mcp",
      "env": {
        "ONESHOT_API_KEY": "osm_live_your_key"
      }
    }
  }
}

HTTP/SSE transport (remote clients)

For remote MCP clients, run the server in SSE mode:

oneshot-mcp --transport sse --port 8080

The server exposes:

  • GET /sse — SSE endpoint for MCP communication.
  • POST /messages/ — Message endpoint.

Connect your MCP client to http://your-server:8080.


Tool reference

oneshot_create_address

Create a temporary email address to receive exactly one email.

Parameters:

ParameterTypeRequiredDefaultDescription
ttl_secondsintegerNo3600TTL before auto-expiry (60-86400).
labelstringNo(none)Label for organizing addresses.

Returns:

{
  "address": "abc123@in.oneshotemail.com",
  "id": "abc123",
  "expires_at": "2026-03-08T12:00:00Z"
}

oneshot_send_email

Send a one-shot email from a disposable address.

Parameters:

ParameterTypeRequiredDescription
tostringYesDestination email address.
subjectstringYesEmail subject.
bodystringYesPlain text body.
html_bodystringNoHTML body.
attachmentsarrayNoList of attachment objects.

Returns:

{
  "address": "def456@out.oneshotemail.com",
  "id": "def456",
  "send_status": "sent"
}

oneshot_check_email

Check if an email has been received (non-blocking).

Parameters:

ParameterTypeRequiredDescription
address_idstringYesThe address ID.

Returns:

{
  "status": "received",
  "email": {
    "from": "noreply@example.com",
    "subject": "Verify your account",
    "text_body": "Click here...",
    "html_body": "<html>...</html>",
    "attachments": []
  }
}

Or if no email yet:

{
  "status": "waiting",
  "email": null
}

oneshot_wait_for_email

Wait for an email to arrive, polling with exponential backoff. This is the primary tool for agentic workflows.

Parameters:

ParameterTypeRequiredDefaultDescription
address_idstringYesThe address ID.
timeout_secondsintegerNo60Max wait time (5-300).

Returns: Full email content when received.

{
  "from": "noreply@example.com",
  "subject": "Verify your account",
  "text_body": "Click the link below to verify...",
  "html_body": "<html>...</html>",
  "attachments": []
}

oneshot_delete_address

Delete an address and its email data.

Parameters:

ParameterTypeRequiredDescription
address_idstringYesThe address ID.

Returns: {"deleted": true}

oneshot_list_addresses

List recent addresses with optional filtering.

Parameters:

ParameterTypeRequiredDefaultDescription
statusstringNo(all)Filter: waiting, received, sent, expired.
labelstringNo(all)Filter by label.
limitintegerNo10Max results (1-100).

Example prompts

Here are prompts you can give to Claude (or any AI agent) that trigger the OneShotMail tools:

Receive a verification email

Create a temporary email address, then sign up for the free trial at https://example.com using that email. Wait for the verification email and tell me the verification link.

The agent will:

  1. Call oneshot_create_address to get a temporary email.
  2. Navigate to the signup page and use the email.
  3. Call oneshot_wait_for_email to receive the verification email.
  4. Extract and return the verification link.

Test an inbound email workflow

Send a test email to invoices@myapp.com with the subject “Invoice #TEST-001” and body “Amount: $150.00”. The email should come from a temporary address.

The agent will call oneshot_send_email with the specified details.

Check on a previous email

List my recent OneShotMail addresses and check if any have received emails.

The agent will call oneshot_list_addresses and then oneshot_check_email for each address.

Multi-step workflow

I need to test the password reset flow. Create a temporary email, then use it to request a password reset at https://myapp.com/forgot-password. Wait for the reset email, extract the reset token, and tell me the token.


Security considerations

  • The MCP server has the same permissions as your API key. It can create addresses, send emails, and delete addresses.
  • Do not share your API key publicly. The MCP server should only be accessible to trusted AI clients.
  • The oneshot_send_email tool can send email to any address. This is by design for testing, but be mindful of abuse potential.
  • Email content returned by the tools may contain sensitive information (OTP codes, verification links, etc.). The AI agent will see this content.

Troubleshooting

”ONESHOT_API_KEY environment variable is not set”

Make sure the environment variable is set in your MCP server configuration. For Claude Desktop, it goes in the env section of claude_desktop_config.json.

Timeout waiting for email

Increase the timeout_seconds parameter. Some services take longer to send emails. Default is 60 seconds.

Tool not appearing in Claude

  1. Make sure oneshot-mcp is installed and on your PATH.
  2. Check that claude_desktop_config.json is valid JSON.
  3. Restart Claude Desktop after configuration changes.
  4. Check the MCP server logs (stderr output) for errors.

Running in verbose mode

oneshot-mcp --verbose

This enables debug logging to stderr, which is useful for diagnosing issues.