daimon.email
Resources

MCP Server

Model Context Protocol server for daimon.email integration

Overview

daimon.email provides a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and other MCP-compatible tools to discover and use email capabilities automatically.

Info

MCP is an open protocol that standardizes how AI assistants connect to external data sources and tools. With MCP, agents can use daimon.email without explicit integration code.

Note

The daimon.email MCP server is currently in development. This documentation describes the planned capabilities. Expected release: Q2 2026.

What is MCP?

The Model Context Protocol (MCP) is a standard developed by Anthropic that allows AI assistants to:

  • Discover available tools (e.g., "create inbox", "send email", "list messages")
  • Invoke tools with parameters
  • Read resources (e.g., recent messages, inbox status)
  • Subscribe to updates (e.g., new message notifications)

Instead of writing custom integration code for every AI assistant, you install one MCP server and all compatible assistants can use it.

MCP Architecture

┌─────────────────┐
│  AI Assistant   │  (Claude Desktop, Cursor, etc.)
│   (MCP Client)  │
└────────┬────────┘

         │ MCP Protocol
         │ (stdio or HTTP)

┌────────▼────────┐
│   MCP Server    │  (daimon.email MCP server)
│  @daimon/mcp    │
└────────┬────────┘

         │ REST API

┌────────▼────────┐
│  daimon.email   │  (api.daimon.email)
│      API        │
└─────────────────┘

The MCP server acts as a bridge between the AI assistant and daimon.email's REST API.

Installation

NPM Package

npm install -g @daimon/mcp-server

With Claude Desktop

Add to your Claude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json on macOS):

{
  "mcpServers": {
    "daimon": {
      "command": "npx",
      "args": ["-y", "@daimon/mcp-server"],
      "env": {
        "DAIMON_API_KEY": "dm_live_abc123..."
      }
    }
  }
}

Restart Claude Desktop. The daimon.email tools will appear automatically.

With Cursor

Add to Cursor's MCP config:

{
  "mcp": {
    "servers": {
      "daimon": {
        "command": "npx",
        "args": ["-y", "@daimon/mcp-server"],
        "env": {
          "DAIMON_API_KEY": "dm_live_abc123..."
        }
      }
    }
  }
}

Restart Cursor. Use daimon.email tools via Cmd+K or inline suggestions.

Available Tools

The MCP server exposes these tools to AI assistants:

create_inbox

Create a new email inbox.

Parameters:

{
  "username": "string (required)",
  "client_id": "string (optional)",
  "metadata": "object (optional)"
}

Returns:

{
  "id": "inbox_abc123",
  "address": "username@daimon.email",
  "created_at": "2026-03-16T14:30:00Z"
}

Example (in Claude Desktop):

User: "Create an inbox called support-bot"

Claude: I'll create an inbox for you. [Uses create_inbox tool with username="support-bot"]

Created inbox: support-bot@daimon.email

list_messages

List messages in an inbox.

Parameters:

{
  "inbox_id": "string (required)",
  "limit": "number (optional, default: 20)",
  "unread_only": "boolean (optional)"
}

Returns:

[
  {
    "id": "msg_abc123",
    "from": "sender@example.com",
    "subject": "Subject",
    "body": "Body text",
    "cta_links": [...],
    "received_at": "2026-03-16T14:30:00Z"
  }
]

Example (in Claude Desktop):

User: "Check my support-bot inbox for new messages"

Claude: [Uses list_messages tool with inbox_id from earlier]

You have 2 new messages:

  1. From: customer@example.com - Subject: "Need help with order"
  2. From: info@service.com - Subject: "Account verification"

get_message

Get full details of a specific message.

Parameters:

{
  "inbox_id": "string (required)",
  "message_id": "string (required)"
}

Returns: Full message object with body, HTML, attachments, CTA links.

send_message

Send an email from an inbox.

Parameters:

{
  "inbox_id": "string (required)",
  "to": "string (required)",
  "subject": "string (required)",
  "body": "string (required)",
  "html": "string (optional)",
  "client_id": "string (optional)"
}

Returns:

{
  "id": "msg_xyz789",
  "status": "queued"
}

Example (in Cursor):

User: "Send a welcome email to new-user@example.com"

Cursor: [Uses send_message tool]

Sent welcome email to new-user@example.com

reply_to_message

Reply to an existing message.

Parameters:

{
  "inbox_id": "string (required)",
  "message_id": "string (required)",
  "body": "string (required)",
  "client_id": "string (optional)"
}

Example (in Claude Desktop):

User: "Reply to that customer support message saying we'll get back to them within 24 hours"

Claude: [Uses reply_to_message tool]

Sent reply to customer@example.com

list_inboxes

List all inboxes in the account.

Parameters: None

Returns: Array of inbox objects.

delete_inbox

Delete an inbox and all its messages.

Parameters:

{
  "inbox_id": "string (required)"
}

Available Resources

MCP resources provide read-only access to data. AI assistants can read these without explicit tool calls.

inbox://inbox_id

Get current state of an inbox.

Example:

User: "What's the status of my support inbox?"

Claude: [Reads inbox://inbox_abc123 resource]

Your support inbox (support-bot@daimon.email):

  • Created: 2 days ago
  • Total messages: 47
  • Unread: 3

inbox://inbox_id/messages

Get recent messages in an inbox.

Example:

User: "Show me the latest messages"

Claude: [Reads inbox://inbox_abc123/messages resource]

Latest messages:

account://capabilities

Get account tier and capabilities.

Example:

User: "Can I send emails?"

Claude: [Reads account://capabilities resource]

Your account is on the free tier. Sending requires upgrading to Developer tier ($9/month).

Prompts

MCP prompts are reusable workflows that AI assistants can invoke.

signup_automation

Automate signup for a service that requires email verification.

Arguments:

{
  "service_url": "string (required)",
  "service_name": "string (required)"
}

Steps:

  1. Create temporary inbox
  2. Sign up for service using inbox address
  3. Poll for verification email
  4. Extract and click verification link
  5. Report success

Example (in Claude Desktop):

User: "Sign me up for newsletter-service.com"

Claude: [Invokes signup_automation prompt]

I'll automate the signup for you.

  1. Created inbox: agent-1234@daimon.email
  2. Signed up at newsletter-service.com
  3. Received verification email
  4. Clicked verification link
  5. Account verified successfully!

monitor_inbox

Monitor an inbox for new messages and notify the user.

Arguments:

{
  "inbox_id": "string (required)",
  "duration_minutes": "number (default: 60)"
}

Example:

User: "Monitor my support inbox for the next hour"

Claude: [Invokes monitor_inbox prompt]

Monitoring support-bot@daimon.email for 60 minutes... (New messages will be reported as they arrive)

Usage Examples

Claude Desktop

After installing the MCP server, use natural language:

User: "I need to test a password reset flow for my app. Can you help?"

Claude: I'll help you test the password reset flow. First, I'll create a temporary inbox.

[Uses create_inbox tool]

Created inbox: test-reset-1234@daimon.email

Now, trigger the password reset on your app using this email address. I'll monitor the inbox for the reset email.

User: "Done. I triggered the reset."

Claude: [Uses list_messages tool to poll for new messages]

Received the reset email! Here's the reset link: https://app.example.com/reset/token_abc123

Click this link to complete the reset.

Cursor

In Cursor, the MCP tools enhance code editing:

User: (Selects code block, presses Cmd+K) "Add error handling if the email fails to send"

Cursor: [Reads account://capabilities to check if sending is enabled]

I notice your account is on the free tier. Free tier can't send emails. I'll add error handling for the SEND_REQUIRES_PAID error:

try {
  await client.inboxes.send(inbox_id, message);
} catch (error) {
  if (error.code === 'SEND_REQUIRES_PAID') {
    const upgradeLink = await client.account.getUpgradeLink();
    console.log('Upgrade required:', upgradeLink.url);
    // Notify operator
  } else {
    throw error;
  }
}

Configuration

The MCP server is configured via environment variables:

VariableRequiredDescription
DAIMON_API_KEYYesYour daimon.email API key
DAIMON_API_URLNoAPI base URL (default: https://api.daimon.email)
MCP_LOG_LEVELNoLogging level: debug, info, warn, error (default: info)
MCP_CACHE_TTLNoCache TTL in seconds (default: 60)

Custom Configuration

For advanced use cases, create a config file at ~/.daimon-mcp.json:

{
  "api_key": "dm_live_abc123...",
  "default_inbox": "inbox_abc123",
  "polling": {
    "interval_seconds": 5,
    "max_retries": 10
  },
  "webhooks": {
    "enabled": true,
    "endpoint": "http://localhost:3000/webhooks/daimon"
  }
}

Development

Build your own MCP tools on top of daimon.email:

Custom MCP Server

import { MCPServer } from '@modelcontextprotocol/sdk';
import { DaimonClient } from 'daimon-email';

const server = new MCPServer({
  name: 'my-email-server',
  version: '1.0.0'
});

const daimon = new DaimonClient({ apiKey: process.env.DAIMON_API_KEY });

// Register custom tool
server.tool('smart_reply', {
  description: 'Generate and send an AI reply to a message',
  parameters: {
    inbox_id: { type: 'string' },
    message_id: { type: 'string' },
    tone: { type: 'string', enum: ['formal', 'friendly', 'concise'] }
  },
  async handler({ inbox_id, message_id, tone }) {
    // Get original message
    const message = await daimon.inboxes.messages.get(inbox_id, message_id);

    // Generate reply using LLM
    const replyBody = await generateReply(message.result.body, tone);

    // Send reply
    return await daimon.inboxes.messages.reply(inbox_id, message_id, {
      body: replyBody,
      client_id: `smart-reply-${message_id}`
    });
  }
});

server.start();

Custom Resource

// Expose a custom resource for inbox analytics
server.resource('analytics://inbox/{inbox_id}', async ({ inbox_id }) => {
  const messages = await daimon.inboxes.messages.list(inbox_id, { limit: 100 });

  const analytics = {
    total: messages.result.length,
    unread: messages.result.filter(m => !m.read).length,
    top_senders: calculateTopSenders(messages.result),
    avg_response_time: calculateAvgResponseTime(messages.result)
  };

  return {
    mimeType: 'application/json',
    text: JSON.stringify(analytics, null, 2)
  };
});

MCP vs Direct API Integration

AspectMCP ServerDirect API
Setup complexityLow (install once)Medium (code per assistant)
Assistant compatibilityAll MCP-compatibleCustom per assistant
Natural languageYesNo
Auto-discoveryYesNo
MaintenanceSingle serverMultiple integrations

Info

Use the MCP server for AI assistants (Claude, Cursor, etc.). Use the direct API for production applications, automation scripts, and custom agents.

Troubleshooting

MCP Server Not Detected

  1. Check config file syntax (invalid JSON breaks MCP detection)
  2. Restart the AI assistant completely
  3. Check logs: tail -f ~/Library/Logs/Claude/mcp*.log

Authentication Errors

  1. Verify API key: echo $DAIMON_API_KEY
  2. Test API key directly: curl -H "Authorization: Bearer $DAIMON_API_KEY" https://api.daimon.email/v1/account
  3. Regenerate API key if needed

Tools Not Appearing

  1. Check MCP server logs for startup errors
  2. Verify the server process is running: ps aux | grep mcp-server
  3. Try manual invocation: npx @daimon/mcp-server

Roadmap

Q2 2026 (Initial Release)

  • Core tools: create_inbox, list_messages, send_message
  • Basic resources: inbox status, recent messages
  • Claude Desktop integration
  • Cursor integration

Q3 2026

  • Webhook support (real-time message notifications)
  • Advanced prompts (signup automation, monitoring)
  • Custom tool framework
  • Streaming responses

Q4 2026

  • Multi-account support
  • Thread management tools
  • Draft tools
  • Analytics resources

Additional Resources