Model Context Protocol integration
MCP Server
Enable AI assistants like Claude to interact with your email through a standardized protocol. The Mailpipe MCP server provides 20 tools for reading, sending, and managing email.
Quick Start
Get your API Key
Generate an API key from your Mailpipe dashboard. Navigate to Settings → API Keys and create a new key with the scopes you need.
Generate API keyConfigure Claude Desktop
Add the Mailpipe 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": {
"mailpipe": {
"command": "npx",
"args": ["@mailpipe/mcp-server"],
"env": {
"MAILPIPE_API_KEY": "mp_live_your-api-key-here"
}
}
}
}Restart Claude Desktop
After saving the configuration file, restart Claude Desktop. You should see the Mailpipe tools available in your conversation. Try asking Claude to "check my inbox" or "list my unread emails".
Installation Options
NPX (Recommended)
Use npx to always run the latest version without installing globally.
npx @mailpipe/mcp-server
Global Install
Install globally for faster startup and offline usage.
npm install -g @mailpipe/mcp-server
Then use mailpipe-mcp as the command in your config.
Available Tools
The MCP server provides 20 tools organized by category. Each tool requires specific permission scopes.
Message Tools
10 toolslist_messagesList email messages with filters for mailbox, read status, starred status, and labels
get_messageGet a single email message by ID including full content and attachments
search_messagesFull-text search across all email messages with relevance scores
archive_messageArchive an email message (removed from inbox but not deleted)
delete_messagePermanently delete an email message
mark_as_readMark an email message as read
mark_as_unreadMark an email message as unread
star_messageStar or unstar an email message
apply_labelApply a label to an email message
remove_labelRemove a label from an email message
Thread Tools
2 toolsget_threadGet an email thread with all its messages
summarize_inboxGet inbox summary including unread count and recent messages
Send Tools
3 toolssend_messageSend a new email message
reply_to_messageReply to an existing email message
forward_messageForward an email message to new recipients
Draft Tools
1 toolscreate_draftCreate a new email draft that can be edited before sending
Mailbox Tools
1 toolslist_mailboxesList all mailboxes connected to your organization
Label Tools
2 toolslist_labelsList all email labels for organizing messages
create_labelCreate a new email label
Permission Scopes
When creating an API key, select the scopes your AI assistant needs. Use the principle of least privilege — only grant the permissions required for your use case.
| Scope | Description |
|---|---|
mail:read | Read email messages and threads |
mail:write | Modify messages (archive, delete, star, labels) |
mail:send | Send new emails and replies |
mail:drafts | Create and manage drafts |
mailbox:read | List connected mailboxes |
labels:read | List labels |
labels:write | Create and modify labels |
Programmatic Usage
For custom integrations, you can use the MCP server programmatically in your Node.js applications.
import { MailpipeMCPServer } from '@mailpipe/mcp-server';
// Create server with API key authentication
const server = new MailpipeMCPServer({
apiKey: process.env.MAILPIPE_API_KEY,
});
// Start with stdio transport (default for CLI usage)
await server.start('stdio');
// Or use HTTP transport for web integrations
await server.start('http', { port: 3000 });
// Or use SSE transport for real-time updates
await server.start('sse', { port: 3001 });OAuth Authentication
For applications requiring OAuth (e.g., multi-tenant SaaS):
const server = new MailpipeMCPServer({
oauthToken: 'oauth-access-token',
refreshToken: 'oauth-refresh-token',
expiresAt: Date.now() + 3600000, // 1 hour
scopes: ['mail:read', 'mail:write', 'mail:send'],
onTokenRefresh: async (newTokens) => {
// Persist refreshed tokens
await saveTokens(newTokens);
},
});MCP Resources
MCP resources provide read-only access to email data through URI patterns.
| URI | Description |
|---|---|
mailpipe://inbox | Inbox summary with unread count and recent messages |
mailpipe://mailboxes | List of all connected email accounts |
mailpipe://labels | All email labels for organization |
mailpipe://messages/{id} | A specific email message by ID |
mailpipe://threads/{id} | An email thread with all messages |
NPM Package
@mailpipe/mcp-server
The MCP server is published as an npm package and can be installed in any Node.js project.
Still have questions?
We can help with anything from setup to scaling.