PurelyMail MCP Server
Provides AI assistants with access to PurelyMail's email management API, enabling user, domain, routing, and billing management through natural language.
README
PurelyMail MCP Server
A Model Context Protocol (MCP) server that provides AI assistants with access to PurelyMail's email management API.
Usage
Run with npx (no installation needed):
npx -y purelymail-mcp-server
Or use Nix (via GitHub flake):
nix run github:gui-wf/purelymail-mcp-server --quiet --refresh
Configure in your MCP client:
{
"mcpServers": {
"purelymail": {
"command": "npx",
"args": ["-y", "purelymail-mcp-server"],
"env": {
"PURELYMAIL_API_KEY": "your-api-key-here"
}
}
}
}
Features
- Type-Safe API Integration: Generated TypeScript client from PurelyMail's swagger specification
- Comprehensive Tool Coverage: Manage users, domains, routing rules, billing, and password reset methods
- Mock Development Mode: Test and develop safely without touching real data
- Resource-Grouped Tools: Intelligent organization of API endpoints into logical tools
- Error Handling: Robust error reporting and validation
Quick Start
1. Prerequisites
- Node.js 20+ (if installing from source)
- PurelyMail API key (for production use)
- Nix (for reproducible development environment - source only)
2. Testing with Mock Data
# Run in mock mode (no API key required)
MOCK_MODE=true npm run dev
# Test with MCP Inspector
MOCK_MODE=true npm run inspector
3. Production Setup
# Set your PurelyMail API key
export PURELYMAIL_API_KEY="your-api-key-here"
# Run the server
npm run dev
# Or build and run
npm run build
node dist/index.js
MCP Integration
Claude Desktop
Add to your Claude Desktop configuration (~/Library/Application Support/Claude/claude_desktop_config.json):
Using npx (recommended - no installation):
{
"mcpServers": {
"purelymail": {
"command": "npx",
"args": ["-y", "purelymail-mcp-server"],
"env": {
"PURELYMAIL_API_KEY": "your-api-key-here"
}
}
}
}
Using Nix from GitHub:
{
"mcpServers": {
"purelymail": {
"command": "nix",
"args": ["run", "github:gui-wf/purelymail-mcp-server", "--quiet", "--refresh"],
"env": {
"PURELYMAIL_API_KEY": "your-api-key-here"
}
}
}
}
When using from source with Nix:
{
"mcpServers": {
"purelymail": {
"command": "nix",
"args": ["run", "/path/to/purelymail-mcp-server#default"],
"env": {
"PURELYMAIL_API_KEY": "your-api-key-here"
}
}
}
}
When using from source with Node.js:
{
"mcpServers": {
"purelymail": {
"command": "node",
"args": ["/path/to/purelymail-mcp-server/dist/index.js"],
"env": {
"PURELYMAIL_API_KEY": "your-api-key-here"
}
}
}
}
Claude Code
For Claude Code, create a .mcp.json file in your project root:
{
"mcpServers": {
"purelymail": {
"command": "npx",
"args": ["-y", "purelymail-mcp-server"],
"env": {
"PURELYMAIL_API_KEY": "${PURELYMAIL_API_KEY}"
}
}
}
}
Other MCP Clients
The server uses stdio transport and follows the MCP specification, making it compatible with any MCP-compliant client.
Available Tools
The server provides 19 individual tools, each corresponding to a specific PurelyMail API operation:
User Management
create_user- Create a new email userdelete_user- Delete an email userlist_users- List all users under your accountmodify_user- Modify user settingsget_user- Retrieve user detailscreate_app_password- Create an app-specific passworddelete_app_password- Delete an app password
Password Reset Management
create_or_update_password_reset_method- Create or update password reset methoddelete_password_reset_method- Delete a password reset methodlist_password_reset_methods- List all password reset methods for a user
Domain Management
add_domain- Add a new domainlist_domains- List all domainsupdate_domain_settings- Update domain settingsdelete_domain- Delete a domainget_ownership_code- Get DNS ownership verification code
Routing Management
create_routing_rule- Create a new routing ruledelete_routing_rule- Delete a routing rulelist_routing_rules- List all routing rules
Billing
check_account_credit- Check current account credit balance
Features
- Type-Safe API Integration: Generated TypeScript client from PurelyMail's swagger specification
- Comprehensive Tool Coverage: Manage users, domains, routing rules, billing, and password reset methods
- Mock Development Mode: Test and develop safely without touching real data
- Resource-Grouped Tools: Intelligent organization of API endpoints into logical tools
- Error Handling: Robust error reporting and validation
Installation
Via npx (Recommended - No Installation)
npx -y purelymail-mcp-server
Via Nix (GitHub Flake)
nix run github:gui-wf/purelymail-mcp-server --quiet --refresh
From Source
# Clone and setup
git clone https://github.com/gui-wf/purelymail-mcp-server.git
cd purelymail-mcp-server
# Using Nix (recommended)
nix develop
# Or use npm directly
npm install
# Build the TypeScript project
npm run build
Tool Usage Patterns
Example: Creating a User
{
"tool": "create_user",
"arguments": {
"userName": "john",
"domainName": "example.com",
"password": "secure-password",
"enableSearchIndexing": true,
"sendWelcomeEmail": true
}
}
Example: Listing Domains
{
"tool": "list_domains",
"arguments": {
"includeShared": false
}
}
Example: Getting User Details
{
"tool": "get_user",
"arguments": {
"userName": "john@example.com"
}
}
Architecture Notes
Type Safety
- All API interactions use generated TypeScript types
- Zero manual type definitions - everything derives from swagger spec
- Automatic validation and error handling
Mock vs Real API
- Mock mode uses swagger response examples when available
- Fallback to sensible defaults for missing examples
- Same interface for both modes ensures consistent behavior
Error Handling
- Structured error responses with context
- API errors are wrapped and formatted for AI consumption
- Network and validation errors are handled gracefully
Documentation
See docs/ for project documentation:
- Development Guide - Development workflow and contributing guidelines
- API Updates - Keeping the server synchronized with PurelyMail API changes
- Troubleshooting - Common issues and solutions
License
This project is licensed under MIT license - see the LICENSE file for details.
Dependencies
This project uses MIT and Apache-2.0 licensed dependencies. See docs/package-licenses.md for full dependency licensing information.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。