A modern, high-performance Model Context Protocol (MCP) server providing domain and IP address lookup services using both traditional Whois and modern RDAP protocols.
✨ Modern Architecture: Clean package structure with uv for dependency management
🚀 High Performance: Asynchronous operations with connection pooling
🛡️ Rate Limiting: Built-in protection for external registry servers
💾 Smart Caching: In-memory LRU cache with TTL for optimal performance
🔍 Dual Protocols: Support for both Whois (TCP) and RDAP (HTTPS) lookups
🌍 Global Coverage: Comprehensive support for major TLDs and Regional Internet Registries
📊 Structured Logging: Detailed logging with structured output
🧪 Comprehensive Testing: Full test suite with pytest and asyncio support
The MCP server communicates via stdin/stdout as per the MCP specification:
A web interface demonstrates the functionality:
Add to your MCP client configuration:
- whois_lookup: Perform Whois lookup for domain or IP address
- rdap_lookup: Perform RDAP lookup for domain or IP address
- whois://domain/{domain} - Domain Whois information
- whois://ip/{ip} - IP Whois information
- rdap://domain/{domain} - Domain RDAP information
- rdap://ip/{ip} - IP RDAP information
Environment variables for customization:
This project uses uv for modern Python package management:
- JSON-RPC 2.0: Standard protocol over stdin/stdout
- Initialize: Handshake and capability negotiation
- Tools: Available lookup functions
- Resources: URI-based data access
- Streaming: Real-time request/response handling
- WhoisService: Asynchronous TCP connections to global Whois servers
- RDAPService: HTTPS requests to structured RDAP endpoints with bootstrap discovery
- CacheService: In-memory LRU cache with TTL for performance optimization
- RateLimiter: Token bucket implementation with per-client and global limits
- Request Processing: MCP client sends JSON-RPC request via stdin
- Validation: Input validation for domain/IP format
- Rate Limiting: Enforce per-client and global rate limits
- Cache Check: Attempt to serve from cache if available
- Service Dispatch: Route to appropriate service (Whois/RDAP)
- Data Retrieval: Query external servers with connection pooling
- Response Parsing: Parse and structure response data
- Caching: Store successful results for future requests
- Response: Return structured JSON-RPC response via stdout
- Generic TLDs: .com, .net, .org, .info, .biz, and more
- Country TLDs: .uk, .de, .fr, .nl, .au, .ca, .jp, and more
- Regional Internet Registries: ARIN, RIPE, APNIC, LACNIC, AFRINIC
- Bootstrap Discovery: Automatic server discovery via IANA bootstrap
- Structured Data: Modern JSON-based responses
- Standardized Format: Consistent data structure across registries
- Fork the repository
- Create a feature branch: git checkout -b feature-name
- Make your changes with tests
- Run the test suite: uv run pytest
- Check code quality: uv run black . && uv run ruff check .
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
.png)


