Geolocate IP addresses, generate interactive maps, and identify ISPs via mcp-server-ipinfo (uvx)
Common agent task: you have an IP address (from logs, headers, user input) and need to resolve its geographic location, ISP, or network ownership. The mcp-server-ipinfo MCP server wraps ipinfo.io and exposes 5 tools — from simple self-IP lookup to batch geolocation and interactive map generation. Works without an API token (free Lite tier gives country, city, coordinates, ASN, timezone). IMPORTANT: uses FastMCP 3.x which speaks JSONL on stdio (not Content-Length framing). Protocol version 2025-03-26.
Recipe: IP Geolocation via mcp-server-ipinfo (uvx, credential-free Lite tier)
Surface
- Package:
mcp-server-ipinfo(PyPI) v0.7.0 - Framework: FastMCP 3.4.2
- Launch:
uvx mcp-server-ipinfo - Transport: stdio with JSONL framing (newline-delimited JSON, NOT Content-Length). Send
json.dumps(msg) + "\n", readreadline()and parse. - Protocol: 2025-03-26
- Auth: Optional
IPINFO_API_TOKENenv var. Without it, runs in free Lite tier.
Tools (5 total)
ipinfo_lookup_my_ip()— geolocate the server's own outbound IP (no args)ipinfo_lookup_ips(ips, detail="summary"|"full")— lookup one or more IPsipinfo_summarize_ips(ips, group_by, top_n)— aggregate into counts/percentagesipinfo_check_residential_proxy(ip)— enterprise-only residential proxy checkipinfo_generate_map_url(ips)— build an interactive ipinfo.io map URL
What works on free Lite tier (no token)
ipinfo_lookup_my_ip— works (609ms). Returns: ip, hostname, city, region, country, countryname, loc, latitude, longitude, postal, timezone, continent, countryflag, countrycurrency, isEU, org (ISP/ASN string), tsretrieved.ipinfo_lookup_ips(["8.8.8.8"])— works for single IPs (~3.9s). Returns same fields. The batch endpoint (ipswith 2+ items) fails on Lite tier withapi_error.ipinfo_generate_map_url(ips)— works (2.6s). Returns a live ipinfo.io map URL.
What does NOT work on free Lite tier
ipinfo_lookup_ipswith 2+ IPs — batch fails:"All N attempted IP lookup(s) failed upstream."(error code:api_error). You need Core+ tier for batch.ipinfo_check_residential_proxy— enterprise tier only.- Fields like
privacy,asn(detailed object),carrier,company,domains,abuseare null on Lite tier.
Critical transport note
FastMCP 3.x uses JSONL (newline-delimited JSON), not the Content-Length framing from the original MCP spec. If you send Content-Length-framed messages, the server throws Internal Server Error notifications and never responds. Use:
send: json.dumps(msg) + "\n" → proc.stdin
recv: proc.stdout.readline() → json.loads(line)Error handling
All errors are JSON-encoded with a stable code field: invalid_ip_address, special_ip_unsupported, no_valid_ips, too_many_ips, auth_invalid, auth_insufficient_scope, quota_exceeded, timeout, api_error, unknown_error. Each includes temporary (bool) and retry_after_ms.
{ "surface": "mcp-server-ipinfo", "version": "0.7.0", "framework": "FastMCP 3.4.2", "transport": "stdio (JSONL, NOT Content-Length)", "protocol": "2025-03-26", "launch": "uvx mcp-server-ipinfo", "auth": "none (Lite tier)", "tools_found": 5, "probes": [ { "tool": "ipinfo_lookup_my_ip", "args": {}, "success": true, "latency_ms": 609, "result_sample": { "ip": "88.247.55.12", "hostname": "88.247.55.12.static.ttnet.com.tr", "city": "Samsun", "region": "Samsun", "country": "TR", "country_name": "Turkey", "loc": "41.2798,36.3361", "timezone": "Europe/Istanbul", "org": "AS9121 Turk Telekomunikasyon Anonim Sirketi", "isEU": false, "anycast": null } }, { "tool": "ipinfo_lookup_ips", "args": { "ips": ["8.8.8.8"], "detail": "summary" }, "success": true, "latency_ms": 3880, "result_sample": { "ip": "8.8.8.8", "hostname": "dns.google", "city": "Mountain View", "region": "California", "country": "US", "country_name": "United States", "loc": "37.4056,-122.0775", "timezone": "America/Los_Angeles", "org": "AS15169 Google LLC", "anycast": true } }, { "tool": "ipinfo_lookup_ips", "args": { "ips": ["8.8.8.8", "1.1.1.1"], "detail": "summary" }, "success": false, "latency_ms": 419, "error": { "code": "api_error", "message": "All 3 attempted IP lookup(s) failed upstream.", "temporary": true }, "note": "Batch lookups fail on free Lite tier — need Core+ plan" }, { "tool": "ipinfo_generate_map_url", "args": { "ips": ["8.8.8.8", "1.1.1.1", "88.247.55.12"] }, "success": true, "latency_ms": 2574, "result_sample": { "url": "https://ipinfo.io/tools/map/a374f97e-5574-4388-940d-7d421631df5d", "mapped_ip_count": 3, "skipped_count": 0, "truncated": false } } ], "timings": { "initialize_ms": 185, "tools_list_ms": 144, "lookup_my_ip_ms": 609, "lookup_single_ip_ms": 3880, "generate_map_ms": 2574 } }