9 Commits

Author SHA1 Message Date
3a677f3bc5 Add DNS automation orchestration tool
- Implement prepare_dns_automation tool that generates comprehensive DNS records
- Tool creates structured DNS plan with CRITICAL, HIGH, MEDIUM, LOW priority records
- Generates completion request for LLM to use its available DNS management MCP tools
- Automatically generates DKIM keys if missing
- Includes MX, A, SPF, DMARC, DKIM, autoconfig, autodiscover, and SRV records
- Provides step-by-step automation instructions and verification commands
- Version bump to 0.5.0 for major DNS automation feature

This creates powerful orchestration where Mailu MCP generates the records
and instructs the LLM to use other MCP tools (Cloudflare, Route53, etc.)
to actually configure DNS - a brilliant multi-tool workflow\!

Tool usage:
prepare_dns_automation(domain="example.com", mail_server_ip="1.2.3.4")

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-16 19:02:46 -06:00
a5f1985c8b Add list tools for Claude Desktop compatibility
- Add dedicated list tools for all entities (list_users, list_domains, etc.)
- Add get tools for individual items (get_user, get_domain, get_alias)
- Keep resources for MCP compliance while adding tools for better Claude Desktop support
- Tools return formatted strings with counts for better readability
- Version bump to 0.4.2 for Claude Desktop compatibility

Tools added:
- list_users, list_domains, list_aliases, list_alternative_domains, list_relays
- get_user, get_domain, get_alias
- list_domain_users, list_domain_managers

This ensures Claude Desktop can easily fetch lists regardless of how it handles resources.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-16 14:42:31 -06:00
10e13b5bc7 Fix resource implementation to follow FastMCP best practices
- Return dict/list directly instead of JSON strings for proper serialization
- FastMCP automatically serializes dicts/lists to JSON
- Update return types from str to dict/list/Union types
- Fix error handling to return structured data instead of strings
- Add Union type import for better type hints
- Version bump to 0.4.1 for resource fixes

Per FastMCP docs:
- Dictionaries/Lists are automatically serialized to JSON
- Resources should return native Python data structures
- FastMCP handles the serialization to proper MCP format

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-16 14:27:36 -06:00
cd40a3e899 Remove OpenAPI integration and simplify to manual tools only
- Remove all OpenAPI/Swagger integration code
- Simplify server to use only manual tools and resources
- Clean up unused imports (asyncio, pathlib, typing.Any/Dict)
- Remove complex fallback logic and OpenAPI validation
- Keep comprehensive 29 tools + 13 resources for full API coverage
- Maintain security automation tools (auto_configure_domain_security, analyze_domain_security)
- Version bump to 0.4.0 for major simplification

Benefits:
- Cleaner, more maintainable code
- No Swagger 2.0 vs OpenAPI 3.x compatibility issues
- Better error handling and reliability
- Reduced complexity while maintaining full functionality

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-16 14:15:36 -06:00
f04b9b9393 Fix HTTP client connection lifecycle management
- Replace shared client instance with fresh client per request
- Add get_mailu_client() function for proper client creation
- Fix "Cannot reopen a client instance" error
- Ensure proper async context management for all HTTP requests
- Version bump to 0.3.2 for connection lifecycle fixes

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-16 13:39:25 -06:00
68d429f80c Add comprehensive security automation tools
- Implement auto_configure_domain_security tool for complete domain security setup
- Add analyze_domain_security tool for security analysis and scoring
- Generate DKIM keys, extract DNS records, and provide security recommendations
- Calculate security scores based on DKIM, SPF, DMARC, and TLSA configurations
- Version bump to 0.3.0 for security enhancements

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-16 13:24:27 -06:00
3fe5bb02ad 🔄 Refactor API endpoints to use MCP resources vs tools (v0.3.0)
ARCHITECTURAL IMPROVEMENT: Proper separation of concerns in MCP design

📖 RESOURCES (Read-only data retrieval):
- mailu://users - All users
- mailu://domains - All domains
- mailu://aliases - All aliases
- mailu://alternative-domains - All alternative domains
- mailu://relays - All relays
- mailu://user/{email} - Specific user details
- mailu://domain/{domain} - Specific domain details
- mailu://alias/{alias} - Specific alias details
- mailu://alternative-domain/{alt} - Specific alternative domain
- mailu://relay/{name} - Specific relay details
- mailu://domain/{domain}/users - Users in specific domain
- mailu://domain/{domain}/managers - Managers for specific domain
- mailu://domain/{domain}/manager/{email} - Specific manager details
- mailu://alias/destination/{domain} - Aliases by destination domain

 TOOLS (Actions and modifications):
- create_user, update_user, delete_user
- create_domain, update_domain, delete_domain, generate_dkim_keys
- create_domain_manager, delete_domain_manager
- create_alias, update_alias, delete_alias
- create_alternative_domain, delete_alternative_domain
- create_relay, update_relay, delete_relay

 BENEFITS:
- Better UX: Resources are discoverable and browsable
- Cleaner separation: Read vs Write operations
- Structured data: Resources return properly formatted JSON
- URI-based access: RESTful resource addressing
- Improved performance: Resources can be cached by clients

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-16 13:16:44 -06:00
4f17a4e3bc 🚀 Add comprehensive Mailu API tool coverage (v0.2.0)
MASSIVE UPGRADE: Added 27 comprehensive tools covering ALL Mailu API endpoints:

📧 USER ENDPOINTS (5 tools):
- list_users, create_user, get_user, update_user, delete_user

🌐 DOMAIN ENDPOINTS (7 tools):
- list_domains, create_domain, get_domain, update_domain, delete_domain
- generate_dkim_keys, list_domain_users

👥 DOMAIN MANAGER ENDPOINTS (4 tools):
- list_domain_managers, create_domain_manager, get_domain_manager, delete_domain_manager

📍 ALIAS ENDPOINTS (6 tools):
- list_aliases, create_alias, get_alias, update_alias, delete_alias, find_aliases_by_domain

🔄 ALTERNATIVE DOMAIN ENDPOINTS (4 tools):
- list_alternative_domains, create_alternative_domain, get_alternative_domain, delete_alternative_domain

🔗 RELAY ENDPOINTS (5 tools):
- list_relays, create_relay, get_relay, update_relay, delete_relay

 FEATURES:
- Complete parameter coverage for all API endpoints
- Comprehensive error handling with try/catch blocks
- Proper request body construction for create/update operations
- All tools support the full Mailu API specification
- Backward compatible with existing basic tools

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-16 13:10:28 -06:00
66d1c0732a Initial commit: FastMCP server for Mailu email API integration
- Complete FastMCP server with OpenAPI integration and fallback tools
- Automatic tool generation from Mailu REST API endpoints
- Bearer token authentication support
- Comprehensive test suite and documentation
- PyPI-ready package configuration with proper metadata
- Environment-based configuration support
- Production-ready error handling and logging
- Examples and publishing scripts included

Features:
- User management (list, create, update, delete)
- Domain management (list, create, update, delete)
- Alias management and email forwarding
- DKIM key generation
- Manager assignment for domains
- Graceful fallback when OpenAPI validation fails

Ready for Claude Desktop integration and PyPI distribution.
2025-07-16 11:55:44 -06:00