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-serverOr install it globally:
npm install -g @agentpost/mcp-serverConfiguration
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
| Tool | Description |
|---|---|
list_inboxes | List all inboxes with optional filtering |
get_inbox | Get details of a specific inbox |
create_inbox | Create a new inbox |
update_inbox | Update inbox display name |
delete_inbox | Delete an inbox |
Message tools
| Tool | Description |
|---|---|
list_messages | List messages for an inbox |
get_message | Get a specific message with full content |
send_message | Send an email from an inbox |
reply_to_message | Reply to a message in its thread |
forward_message | Forward a message to new recipients |
Thread tools
| Tool | Description |
|---|---|
list_threads | List conversation threads for an inbox |
get_thread | Get thread details and messages |
Draft tools
| Tool | Description |
|---|---|
list_drafts | List unsent drafts |
create_draft | Create a new draft |
update_draft | Edit a draft |
send_draft | Send a draft |
delete_draft | Discard a draft |
Label tools
| Tool | Description |
|---|---|
add_labels | Add labels to a message or thread |
remove_labels | Remove labels from a message or thread |
list_labels | List all labels in use |
Attachment tools
| Tool | Description |
|---|---|
get_attachment | Get attachment details and download URL |
download_attachment | Download attachment content (base64-encoded) |
Domain tools
| Tool | Description |
|---|---|
list_domains | List custom domains |
add_domain | Add a custom domain |
verify_domain | Trigger domain verification |
Smart compose
| Tool | Description |
|---|---|
compose_email | Generate 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_emailtool provides AI-assisted drafting based on conversation context - For self-hosted instances, set
AGENTPOST_BASE_URLto point to your API server