Releases: duksh/peerglass
PeerGlass v1.0.0 — Initial Release
🔍 PeerGlass v1.0.0 — Initial Release
Internet Resource Intelligence. All 5 RIRs. AI-native. RDAP throughout.
Protocol note: PeerGlass uses RDAP (RFC 7480–7484) exclusively —
the IANA-mandated JSON successor to legacy plain-text WHOIS.
Where you see "historical-whois" in API responses, that is RIPE Stat's
own endpoint name, not our protocol choice.
🚀 What's in v1.0.0
17 MCP Tools — Full Coverage Across 4 Phases
Phase 1 — Registry Queries (5 tools)
rir_query_ip— Query all 5 RIRs for any IPv4/IPv6 address in parallelrir_query_asn— Query all 5 RIRs for any Autonomous System Number in parallelrir_get_abuse_contact— Find the abuse contact for any IP address globallyrir_server_status— Live health check of all 5 RDAP serversrir_cache_stats— Inspect the in-memory query cache state and TTLs
Phase 2 — Routing Intelligence (4 tools)
rir_check_rpki— Validate RPKI/ROA status for any prefix + ASN pairrir_check_bgp_status— Check BGP visibility for any prefix or ASNrir_get_announced_prefixes— List all BGP-announced prefixes for an ASNrir_audit_org— Audit all IP blocks and ASNs registered to an organisation
Phase 3 — Historical Intelligence (4 tools)
rir_prefix_history— Full ownership and status timeline for any prefix or ASNrir_detect_transfers— Detect cross-organisation and cross-RIR resource transfersrir_ipv4_stats— Global IPv4/IPv6/ASN exhaustion dashboard (all 5 RIRs)rir_prefix_overview— Prefix hierarchy: parent block, child assignments, BGP status
Phase 4 — Peering, IXPs, Health & Monitoring (4 tools)
rir_get_peering_info— PeeringDB peering policy + BGP neighbours for any ASNrir_lookup_ixps— Search Internet Exchange Points globally by country or namerir_network_health— Composite health check: RPKI + BGP + RDAP in one callrir_change_monitor— Monitor any prefix or ASN for changes since last baseline
15 REST API Endpoints
Every MCP tool is also available as a plain HTTP endpoint — no AI client required.
Compatible with OpenAI function calling, Gemini tool use, curl, and any HTTP client.
GET /v1/ip/{ip} — RDAP lookup for an IP address
GET /v1/asn/{asn} — RDAP lookup for an ASN
GET /v1/abuse/{ip} — Abuse contact for any IP
GET /v1/rpki — RPKI validation (?prefix=...&asn=...)
GET /v1/bgp/{resource} — BGP visibility status
GET /v1/announced/{asn} — Announced prefixes for an ASN
GET /v1/org — Audit all resources for an org name
GET /v1/history/{resource} — Prefix/ASN ownership history
GET /v1/transfers/{resource} — Transfer detection
GET /v1/stats/ipv4 — Global IPv4/IPv6/ASN stats
GET /v1/overview/{prefix} — Prefix hierarchy overview
GET /v1/peering/{asn} — Peering info from PeeringDB
GET /v1/ixp — IXP search and listing
GET /v1/health/{resource} — Composite network health check
GET /v1/monitor/{resource} — Change monitoring (delta report)
External APIs Integrated
| API | Purpose |
|---|---|
| AFRINIC, APNIC, ARIN, LACNIC, RIPE NCC RDAP | IP/ASN registration data |
IANA RDAP Bootstrap (data.iana.org/rdap/) |
Automatic RIR routing per query |
Cloudflare RPKI (rpki.cloudflare.com) |
ROA validation |
| RIPE Stat — bgp-state, announced-prefixes, asn-neighbours | BGP routing data |
| RIPE Stat — historical-whois, allocation-history | Historical timelines |
| RIPE Stat — prefix-overview, routing-status | Prefix hierarchy |
| PeeringDB — /api/net, /api/ix, /api/netixlan | Peering & IXP data |
| NRO Extended Delegation Stats | Global IPv4/IPv6/ASN exhaustion counts |
Architecture Highlights
- True parallel queries via
asyncio.gather()— all 5 RIRs fired simultaneously (1–2s vs 6–8s sequential) - IANA Bootstrap auto-routes every query to the correct authoritative RIR
- Tiered caching — TTLs tuned per data type (5 min for BGP, 24 hours for daily stats)
- Pydantic v2 data models throughout
- MCP stdio server — compatible with Claude Desktop, Cursor, and any MCP client
- FastAPI REST layer — auto-generates Swagger UI at
/docs - OpenAI / Gemini schema at
/v1/meta/openai-tools— paste directly into function-calling configs
Test Suite
Two independent test suites ship with v1.0.0:
-
test_peerglass.py— Unit/static tests. No internet required. Runs in under 3 seconds.
Checks: compile, branding, RDAP URLs, protocol headers, MCP name, tool count (17), REST routes (15), FastAPI runtime, README. -
test_integration.py— Integration tests. Hits real RDAP, BGP, and RPKI APIs.
Fixtures: Cloudflare AS13335, Google AS15169, 1.1.1.0/24. Every assertion checks real data.
python test_peerglass.py # instant, no internet
python test_integration.py # requires internet, ~30s📦 Installation
git clone https://github.com/duksh/peerglass
cd peerglass
pip install -e .Claude Desktop config (claude_desktop_config.json):
{
"mcpServers": {
"peerglass": {
"command": "peerglass",
"args": []
}
}
}REST API:
uvicorn api:app --host 0.0.0.0 --port 8000 --reload
# → http://localhost:8000/docs📋 Files in this Release
| File | Purpose |
|---|---|
server.py |
MCP server — 17 tools |
api.py |
FastAPI REST layer — 15 endpoints |
rir_client.py |
All async HTTP calls to external APIs |
normalizer.py |
Unify RDAP responses across 5 RIRs |
formatters.py |
Markdown and JSON output formatting |
cache.py |
In-memory TTL cache |
models.py |
Pydantic v2 data models |
test_peerglass.py |
Unit/static test suite |
test_integration.py |
Live integration test suite |
pyproject.toml |
Package metadata and dependencies |
DEMO.md |
Live demo guide with example queries |
CONTRIBUTING.md |
Contribution guide |
CODE_OF_CONDUCT.md |
Community standards |
🌍 RIR Coverage
| RIR | Region | RDAP Endpoint |
|---|---|---|
| AFRINIC | Africa (54 nations) | rdap.afrinic.net/rdap |
| APNIC | Asia-Pacific (56 economies) | rdap.apnic.net |
| ARIN | North America | rdap.arin.net/registry |
| LACNIC | Latin America & Caribbean | rdap.lacnic.net/rdap |
| RIPE NCC | Europe, Middle East, Central Asia | rdap.db.ripe.net |
🔮 What's Next (v1.1 Roadmap)
- WebSocket streaming for
rir_change_monitor - Prometheus metrics endpoint for NOC dashboards
- GCP Cloud Run one-click deployment guide
- Docker image (
ghcr.io/duksh/peerglass) - MANRS conformance check integration
- Additional language support for RIPE Stat APIs
🙏 Acknowledgements
PeerGlass builds on the open data and infrastructure maintained by:
- AFRINIC, APNIC, ARIN, LACNIC, RIPE NCC — for operating public RDAP servers
- IANA — for the RDAP Bootstrap registry and RFC 7480–7484 mandate
- Cloudflare — for the public RPKI validation API
- RIPE NCC — for RIPE Stat (BGP, historical, routing data)
- PeeringDB — for the open peering and IXP database
- NRO — for the Extended Delegation Statistics
📄 License: MIT
📦 PyPI: pip install peerglass (coming soon)
🐛 Issues: https://github.com/duksh/peerglass/issues
💬 Discussions: https://github.com/duksh/peerglass/discussions