A Model Context Protocol (MCP) server that provides AI assistants with access to PurelyMail's email management API.
Run with npx (no installation needed):
npx -y purelymail-mcp-serverOr use Nix (via GitHub flake):
nix run github:gui-wf/purelymail-mcp-server --quiet --refreshConfigure in your MCP client:
{
"mcpServers": {
"purelymail": {
"command": "npx",
"args": ["-y", "purelymail-mcp-server"],
"env": {
"PURELYMAIL_API_KEY": "your-api-key-here"
}
}
}
}- 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
- Node.js 20+ (if installing from source)
- PurelyMail API key (for production use)
- Nix (for reproducible development environment - source only)
# Run in mock mode (no API key required)
MOCK_MODE=true npm run dev
# Test with MCP Inspector
MOCK_MODE=true npm run inspector# 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.jsAdd to your Claude Desktop configuration (~/Library/Application Support/Claude/claude_desktop_config.json):
{
"mcpServers": {
"purelymail": {
"command": "npx",
"args": ["-y", "purelymail-mcp-server"],
"env": {
"PURELYMAIL_API_KEY": "your-api-key-here"
}
}
}
}{
"mcpServers": {
"purelymail": {
"command": "nix",
"args": ["run", "github:gui-wf/purelymail-mcp-server", "--quiet", "--refresh"],
"env": {
"PURELYMAIL_API_KEY": "your-api-key-here"
}
}
}
}{
"mcpServers": {
"purelymail": {
"command": "nix",
"args": ["run", "/path/to/purelymail-mcp-server#default"],
"env": {
"PURELYMAIL_API_KEY": "your-api-key-here"
}
}
}
}{
"mcpServers": {
"purelymail": {
"command": "node",
"args": ["/path/to/purelymail-mcp-server/dist/index.js"],
"env": {
"PURELYMAIL_API_KEY": "your-api-key-here"
}
}
}
}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}"
}
}
}
}The server uses stdio transport and follows the MCP specification, making it compatible with any MCP-compliant client.
The server provides 19 individual tools, each corresponding to a specific PurelyMail API operation:
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
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
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
create_routing_rule- Create a new routing ruledelete_routing_rule- Delete a routing rulelist_routing_rules- List all routing rules
check_account_credit- Check current account credit balance
- 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
npx -y purelymail-mcp-servernix run github:gui-wf/purelymail-mcp-server --quiet --refresh# 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": "create_user",
"arguments": {
"userName": "john",
"domainName": "example.com",
"password": "secure-password",
"enableSearchIndexing": true,
"sendWelcomeEmail": true
}
}{
"tool": "list_domains",
"arguments": {
"includeShared": false
}
}{
"tool": "get_user",
"arguments": {
"userName": "[email protected]"
}
}- All API interactions use generated TypeScript types
- Zero manual type definitions - everything derives from swagger spec
- Automatic validation and error handling
- Mock mode uses swagger response examples when available
- Fallback to sensible defaults for missing examples
- Same interface for both modes ensures consistent behavior
- Structured error responses with context
- API errors are wrapped and formatted for AI consumption
- Network and validation errors are handled gracefully
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
This project is licensed under a custom non-commercial license - see the LICENSE file for details.
This software is available for non-commercial use only. For commercial licensing, please contact [email protected].
This project uses MIT and Apache-2.0 licensed dependencies. See docs/package-licenses.md for full dependency licensing information.