Give your agent these instructions
Use IP Info for approximate public-IP geolocation and ASN lookup.
Authentication: none. Cost: free.
If an IP is supplied: GET https://ip-info.com/json?ip=<URL-encoded-IP>.
If checking your own execution environment: GET https://ip-info.com/json.
For only country_code, region, city and timezone: GET https://ip-info.com/json_lite, or /json_lite?ip=<URL-encoded-IP> for a supplied IP.
For only your caller IP as plain text: GET https://ip-info.com/myip (address plus newline; no JSON).
Do not describe your server/proxy exit as the human user's IP.
Use country in /json or country_code in /json_lite for country-code comparisons. Use /json for numeric ASN checks.
Treat null as unavailable; never fabricate missing data.
Treat location and network data as approximate and potentially outdated.
Geolocation is approximate. This is not VPN/proxy detection.
Handle JSON errors and use bounded backoff for temporary failures.Caller does not mean human user
When an agent calls /json or /json_lite, the response describes its runtime or proxy’s network exit. To check another person’s IP, supply an IP they have explicitly provided or your application has legitimately obtained. Do not infer it from the agent’s own connection.
Minimal integration
# Python 3; standard library only
import json
from urllib.request import urlopen
with urlopen("https://ip-info.com/json?ip=8.8.8.8", timeout=10) as response:
print(json.load(response))Need only the location?
Use /json_lite for exactly country_code, region, city and timezone. Each value is a string or null. Use /json when you also need the IP, ISP or ASN. See the lite endpoint reference.
# Python 3; standard library only
import json
from urllib.request import urlopen
with urlopen("https://ip-info.com/json_lite?ip=8.8.8.8", timeout=10) as response:
print(json.load(response))Predictable data, clear limitations
Responses contain explicit numeric, string, boolean and nullable fields. There are no login pages or API-key exchanges. Handle unavailable fields and preserve uncertainty around location and network classifications.
The human reference, OpenAPI schema and text reference are generated from the same response definition. No MCP server is required: ordinary HTTP is sufficient.