High-performance ASN lookup system with SIMD acceleration, multi-level caching, and MCP server for AI agents.
- SIMD Acceleration - Fast IP lookups with AVX2 optimization
- Apache Arrow/Parquet - Columnar storage for IP ranges
- Multi-Level Cache - LRU + RocksDB cold storage
- MCP Server - JSON-RPC 2.0 API for AI agents
- Network Enrichment - DNS, WHOIS, GeoIP integration
- CIDR Operations - /8-/32 range queries
- Parallel Processing - Rayon batch operations
- Production Ready - Rate limiting, metrics, Docker support
Benchmarked on modern hardware using hyperfine (100 runs):
CLI Lookup (includes startup + data load + lookup):
Time (mean Β± Ο): 218.9 ms Β± 4.9 ms
Range (min β¦ max): 207.0 ms β¦ 237.5 ms
Note: Cold start time includes TSV parsing (28MB data). For high-throughput workloads, use the MCP server or keep the CLI process warm to amortize startup costs.
git clone https://github.com/copyleftdev/rasn.git
cd rasn
make install # Downloads data + installs binary (no sudo!)
# or: ./install.shData is automatically downloaded on first install.
cargo install --path crates/rasn-cliNote: Binary-only install requires manual data setup. See INSTALL.md for details.
Build locally:
docker build -t rasn:latest .
docker-compose up -d# IP lookup
rasn lookup 8.8.8.8
# Batch processing
rasn batch --file ips.txt --workers 10
# JSON output
rasn lookup --output json 1.1.1.1
# MCP server (for Claude Desktop)
rasn mcp stdioAdd to Claude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json):
{
"mcpServers": {
"rasn": {
"command": "rasn",
"args": ["mcp", "stdio"]
}
}
}Available MCP Tools:
lookup_ip- IP to ASN lookuplookup_asn- ASN to IP rangeslookup_domain- DNS + ASN resolutionbulk_lookup- Batch processingcidr_analyze- CIDR calculationsreverse_lookup- PTR recordsenrich_data- WHOIS + GeoIP
# Build image
docker build -t rasn:latest .
# CLI usage
docker run --rm rasn:latest lookup 8.8.8.8
# MCP Server
docker run --rm -it rasn:latest mcp stdio
# Docker Compose
docker-compose up -dEnvironment Variables:
RASN_API_KEY- API key for external services
Check Status:
rasn auth status# Install dev tools and git hooks
make dev-setup# Run tests
cargo test --all-features --workspace
# Check format
cargo fmt --all -- --check
# Run clippy
cargo clippy --all-features --workspace -- -D warnings
# Build docs
cargo doc --all-features --no-deps --workspace
# Run all checks (same as pre-commit)
./hooks/pre-commitrasn/
βββ crates/
β βββ rasn-core/ # Core types & security
β βββ rasn-arrow/ # Arrow/Parquet + SIMD
β βββ rasn-cache/ # Multi-level caching
β βββ rasn-cidr/ # CIDR operations
β βββ rasn-client/ # HTTP client + rate limiting
β βββ rasn-db/ # RocksDB storage
β βββ rasn-geoip/ # GeoIP integration
β βββ rasn-mcp/ # MCP JSON-RPC server
β βββ rasn-resolver/ # DNS resolution
β βββ rasn-whois/ # WHOIS client
β βββ rasn-cli/ # CLI interface
βββ examples/ # Usage examples
βββ docs/ # Documentation
MIT - see LICENSE for details.
