AgentPost
Integrations

MCP Server

Use AgentPost from any Model Context Protocol compatible AI tool

The AgentPost MCP server exposes email operations as tools that AI assistants can call directly. Any MCP-compatible client -- including Claude Desktop, Claude Code, Cursor, Windsurf, and others -- can use the MCP server to manage inboxes, send email, read messages, and more.

What is MCP?

The Model Context Protocol (MCP) is an open standard for connecting AI assistants to external tools and data sources. Instead of writing custom integration code, you configure an MCP server and the AI assistant discovers and uses its tools automatically.

Installation

The AgentPost MCP server is available as an npm package:

npx @agentpost/mcp-server

Or install it globally:

npm install -g @agentpost/mcp-server

Configuration

The MCP server requires your AgentPost API key. Set it as an environment variable:

export AGENTPOST_API_KEY="ap_sk_your_api_key_here"

Optionally set a custom API base URL (for self-hosted instances):

export AGENTPOST_BASE_URL="https://api.your-instance.com"

Available tools

The MCP server provides tools for all major AgentPost operations:

Inbox tools

ToolDescription
list_inboxesList all inboxes with optional filtering
get_inboxGet details of a specific inbox
create_inboxCreate a new inbox
update_inboxUpdate inbox display name
delete_inboxDelete an inbox

Message tools

ToolDescription
list_messagesList messages for an inbox
get_messageGet a specific message with full content
send_messageSend an email from an inbox
reply_to_messageReply to a message in its thread
forward_messageForward a message to new recipients

Thread tools

ToolDescription
list_threadsList conversation threads for an inbox
get_threadGet thread details and messages

Draft tools

ToolDescription
list_draftsList unsent drafts
create_draftCreate a new draft
update_draftEdit a draft
send_draftSend a draft
delete_draftDiscard a draft

Label tools

ToolDescription
add_labelsAdd labels to a message or thread
remove_labelsRemove labels from a message or thread
list_labelsList all labels in use

Attachment tools

ToolDescription
get_attachmentGet attachment details and download URL
download_attachmentDownload attachment content (base64-encoded)

Domain tools

ToolDescription
list_domainsList custom domains
add_domainAdd a custom domain
verify_domainTrigger domain verification

Smart compose

ToolDescription
compose_emailGenerate email content using context from recent messages

Claude Desktop configuration

Add the AgentPost MCP server to your Claude Desktop configuration file:

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

{
  "mcpServers": {
    "agentpost": {
      "command": "npx",
      "args": ["@agentpost/mcp-server"],
      "env": {
        "AGENTPOST_API_KEY": "ap_sk_your_api_key_here"
      }
    }
  }
}

After saving, restart Claude Desktop. The AgentPost tools will appear in the tools menu.

Example usage

Once configured, you can ask Claude to perform email operations directly:

  • "Check my support inbox for new messages"
  • "Reply to the latest email from Alice with a shipping update"
  • "Create a new inbox called deploy-alerts for CI/CD notifications"
  • "Label all messages from @acmeco.com as priority-high"
  • "Forward the invoice attachment to the accounting team"
  • "Show me all threads labeled needs-response"

Claude will call the appropriate MCP tools to complete these tasks.

Tips

  • The MCP server uses stdio transport, so it runs as a subprocess of the AI client
  • Each tool call makes one or more API requests to your AgentPost instance
  • Attachment downloads are returned as base64-encoded strings since MCP's text transport cannot carry binary data
  • The compose_email tool provides AI-assisted drafting based on conversation context
  • For self-hosted instances, set AGENTPOST_BASE_URL to point to your API server

On this page