IPinfo MCP Server
The IPinfo MCP Server gives AI assistants and MCP-compatible developer tools direct access to IP address intelligence from IPinfo. You can connect clients such as Claude Desktop, VS Code, Cursor, LM Studio, Gemini CLI, Claude Code, and Codex CLI to query geolocation, ASN, privacy, residential proxy, and quota data.
Point your MCP client to this URL:
https://mcp.ipinfo.io/
Quick Install
Visit https://mcp.ipinfo.io/ in a browser. Paste your IPinfo token into the token field and the page will generate ready-to-copy configurations for every supported client. For Claude Desktop, VS Code, Cursor, and LM Studio, one-click install buttons are also available on the landing page.
If you prefer manual setup, use the configurations in the next section.
Authentication
The MCP server reads the IPinfo API token from the Authorization: Bearer <IPINFO_TOKEN> header on each request. No server-side account or login is required, the token alone authenticates requests and determines which tools and fields are available based on your plan.
Get a free token at ipinfo.io/signup.
Client Setup
Paste your IPinfo token into the examples below to configure the server in your MCP client.
Code-Focused MCP Clients
Install the server in VS Code or add it manually to .vscode/mcp.json.
Full Instructions: https://community.ipinfo.io/t/using-the-official-ipinfo-mcp-server-in-vs-code/7255
Requires VS Code 1.99+
{
"servers": {
"ipinfo": {
"type": "http",
"url": "https://mcp.ipinfo.io/",
"headers": {
"Authorization": "Bearer <IPINFO_TOKEN>"
}
}
}
}
General MCP Clients
Use MCPB (a helper app for adding remote MCP servers) or add the server manually to claude_desktop_config.json.
- macOS:
~/Library/Application Support/Claude/ - Windows:
%APPDATA%\Claude\ - Linux:
~/.config/Claude/
Full Instructions: https://community.ipinfo.io/t/using-the-official-ipinfo-mcp-server-in-claude-desktop/7261
{
"mcpServers": {
"ipinfo": {
"command": "npx",
"args": [
"mcp-remote",
"https://mcp.ipinfo.io/",
"--header",
"Authorization: Bearer <IPINFO_TOKEN>"
]
}
}
}
Restart Claude Desktop after saving.
Tools
Available Tools
The MCP server exposes the following IPinfo tools.
ipinfo_lookup
Geolocation, network, and metadata for IP addresses. Set detailed=true for city-level geolocation, privacy flags, and richer ASN data. The detailed=true mode requires a paid token.
ipinfo_geolocate
Geographic location data for one or more IP addresses. The free tier returns country and continent, while detailed=true adds city, region, coordinates, timezone, and postal code.
ipinfo_asn
Autonomous system and network ownership information, including ASN, organization name, and domain. Set detailed=true for network type such as ISP, hosting, business, or education, and last_changed metadata.
ipinfo_check_privacy
Checks whether IP addresses use VPN, proxy, relay, or Tor. Also includes flags for anycast, hosting, mobile, and satellite networks. With a Plus-tier token, the anonymous.name field returns the VPN provider name when available.
ipinfo_check_residential_proxy
Detects residential proxy usage and returns the proxy service name, last seen date, and observation frequency.
ipinfo_quota
Returns API usage and remaining quota, including daily and monthly counts, plan limits, and remaining requests.
Tool Selection Quick Guide
Use this mapping to choose the right tool for the user intent.
| User Intent | Recommended Tool | Notes |
|---|---|---|
| Full IP profile (geo + network + privacy flags) | ipinfo_lookup | Use detailed=true for city-level + richer fields (paid feature) |
| Country/continent only | ipinfo_geolocate | Default mode is lightweight |
| City/region/coordinates/timezone | ipinfo_geolocate | Requires detailed=true (paid feature) |
| ASN and owner/network details | ipinfo_asn | Use detailed=true for network type (paid feature) |
| VPN/proxy/Tor/anonymity checks | ipinfo_check_privacy | Paid feature |
| Residential proxy checks | ipinfo_check_residential_proxy | Paid feature/add-on |
| Usage and quota | ipinfo_quota | No pagination |
Usage Guidance
Response Format
Every paginated tool returns a consistent response shape with four sections: _pagination, _meta, results, and optionally validation_errors.
Example response from ipinfo_lookup:
{
"_pagination": {
"total_results": 2,
"page": 1,
"page_size": 25,
"total_pages": 1,
"has_next": false,
"has_previous": false
},
"_meta": {
"api_calls_made": 1,
"from_cache": 0
},
"results": {
"8.8.8.8": {
"ip": "8.8.8.8",
"country": "United States",
"country_code": "US",
"continent": "North America",
"continent_code": "NA",
"asn": "AS15169",
"as_name": "Google LLC",
"as_domain": "google.com"
},
"1.1.1.1": {
"ip": "1.1.1.1",
"country": "Australia",
"country_code": "AU",
"continent": "Oceania",
"continent_code": "OC",
"asn": "AS13335",
"as_name": "Cloudflare Inc.",
"as_domain": "cloudflare.com"
}
},
"validation_errors": {
"192.168.1.1": "'192.168.1.1' is a private IP address. Only public IP addresses can be looked up."
}
}
Successful results are keyed by IP in the results object. Invalid inputs appear in validation_errors instead of causing the whole request to fail.
On error, a tool returns a different shape:
{
"error": true,
"code": "ACCESS_DENIED",
"message": "You don't have access to this feature.",
"suggestion": "Tell the user they can get access by upgrading at /pricing"
}
Caching and Quota
The server maintains an in-memory cache for the lifetime of the MCP session. Repeat lookups of the same IP are served from cache and do not consume API quota. The cache is scoped by tool mode (lite, detailed, residential proxy) so a detailed lookup will not be served from a lite cache entry.
Each response includes a _meta object reporting api_calls_made (how many times the IPinfo API was called during this tool invocation) and from_cache (how many results were served from the session cache). Clients do not need to deduplicate input lists, the cache handles that automatically.
Prompting Best Practices
- Include the exact tool name in the prompt.
- Specify required output fields explicitly.
- If city-level output is needed, require
detailed=true. - When applicable, require
validation_errorsto be returned. - For large inputs on paginated tools, require pagination completion (
page_size<=1000and iterate all pages).
Example template:
Use exactly <tool_name> for these IPs: [IPs].
Return fields: [field list].
When applicable, also return validation_errors and pagination metadata.
If error=true, map code to recovery action.
Prompt Scenario Table
Use this quick-reference table to improve prompt quality when working with AI assistants and the IPinfo MCP tools.
| Wrong Prompt | Likely Result | Advice | Correct Prompt |
|---|---|---|---|
| Tell me about this IP: 8.8.8.8 | Ambiguous request. The assistant may return only one data dimension such as location or ASN. | Specify the exact tool and fields you need. | Use ipinfo_lookup with detailed=true for 8.8.8.8. Return geolocation, ASN, privacy flags, and validation_errors. |
| Is this IP suspicious? | Subjective output without consistent checks. | Replace vague wording with measurable privacy indicators. | Use ipinfo_check_privacy for 1.1.1.1 and return is_anonymous, anonymous.is_vpn, anonymous.is_proxy, anonymous.is_tor, and is_hosting. |
| Who owns this IP and is it a VPN? | The assistant may call only one tool and miss part of the answer. | Split mixed intent into tool-specific steps. | Step 1: call ipinfo_asn for 52.95.110.1 and return ASN/name/domain. Step 2: call ipinfo_check_privacy for the same IP and return VPN/proxy/Tor flags. |
| Get city for these IPs | The assistant may call geolocation in default mode and only return country/continent. | Force detailed mode for city-level output. | Use ipinfo_geolocate with detailed=true for [IPs]. Return city, region, country, latitude, longitude, and timezone. |
| Check these 2,300 IPs | One call may only process a slice and appear incomplete. | Explicitly require pagination completion. | Process 2,300 IPs with page_size=1000, iterate all pages, and aggregate all results and validation_errors. |
| Find proxy IPs | The assistant may use residential proxy only and miss VPN/Tor/proxy indicators. | Clarify whether you need general privacy detection or only residential proxy checks. | Use ipinfo_check_privacy for VPN/proxy/Tor detection. Use ipinfo_check_residential_proxy only for residential proxy classification. |
| The tool returned nothing | Empty results may be misread as a hard failure. | Validate pagination, input validity, and error object first. | If results is empty, first check _pagination, then validation_errors, then top-level error to explain the cause. |
| Use the best tool | Tool choice may vary and be incorrect for your intent. | For critical workflows, always pin the tool name. | Use exactly ipinfo_check_privacy for these IPs and do not substitute another tool. Include validation_errors in the output. |
| Why did this fail? | No clear recovery action is provided. | Translate error codes into user actions. | If error=true, map code to action: NO_TOKEN -> configure token, ACCESS_DENIED -> upgrade plan, RATE_LIMITED -> retry with backoff. |
| Enrich these 2,000 IPs | The assistant may repeatedly report only the first 25 IPs and claim completion. | Force full pagination traversal and require per-page accounting. | Process all IPs with page_size=1000 and iterate page=1.._pagination.total_pages. Return processed_count, remaining_count, and unique IP count to prove full coverage. |
| Re-run enrichment with latest data | The assistant may reuse its native memory/cache and avoid making fresh tool calls. | Explicitly instruct no memory reuse and require evidence of new calls. | Do not use prior outputs or chat memory. Call the MCP tool again for all IPs and return current _meta (api_calls_made, from_cache) and timestamped run summary. |
| Get full details for these IPs | The assistant may keep using lite-style results and omit detailed fields. | Require detailed mode and reject incomplete field sets. | Use ipinfo_lookup with detailed=true. Response is invalid unless it includes city-level geo and privacy/network flags where available. |
| Write results to output file | The assistant may summarize in chat but skip overwriting the target file. | Make file write requirements explicit and verifiable. | Overwrite <output_file> with the new complete results (do not append). Confirm by reporting file path, final record count, and that previous content was replaced. |
Response Handling Rules
When interpreting any tool response, use this order:
- Check top-level
errorfirst. - Check
_paginationto confirm result coverage. - Read
resultsfor successful IPs. - Read
validation_errorsfor rejected IPs.
This prevents common misreads where empty results are treated as API failures.
Validation and Pagination Behavior
- Input supports mixed-quality IP lists.
- Valid public IPs are processed.
- Invalid/private/loopback/reserved/multicast/bogon IPs appear in
validation_errors. - A single response can contain both successful
resultsandvalidation_errors. page_sizedefaults to 25 and is capped at 1000.- The underlying batch endpoint processes up to 1000 IPs per API call.
- Requesting a page beyond available data returns empty
results(not a hard error).
Error Codes and Recovery Actions
Top-level errors (when the whole request fails) use the following codes. For per-IP validation issues such as private or malformed addresses, inspect the validation_errors field in the response instead.
| Error Code | Meaning | Recommended Action |
|---|---|---|
NO_TOKEN | Token is missing | Configure bearer token in MCP client settings |
ACCESS_DENIED | Token lacks required plan/feature | Upgrade plan or use supported tool/mode |
RATE_LIMITED | Request rate exceeded | Retry with backoff or use a higher tier |
API_ERROR | Upstream API error | Retry; escalate if persistent |
Notes
- The MCP server is powered by the IPinfo API.
- All examples above use bearer token authentication through the
Authorizationheader. - Support for manual setup details can vary slightly by client version.