IPWho MCP Server: IP Geolocation for AI Agents
The IPWho MCP server lets AI agents look up IP addresses through the IPWho IP geolocation API. MCP (Model Context Protocol) is the open standard that Claude Code, Claude Desktop, Cursor, VS Code and other AI tools use to call external tools. Once connected, you can ask your agent where an IP is, which network it belongs to, or to enrich a whole list of IPs from a log, and it calls IPWho for you.
- Source: lavrox/ipwho-mcp (MIT)
- npm:
@ipwho/mcp-server - Hosted endpoint:
https://mcp.ipwho.org/mcp - API key: ipwho.org/free-plan (2,000 lookups a day, no card)
You need an IPWho API key. Every lookup the agent makes counts against your plan’s quota, exactly as if you had called the API yourself.
| Tool | What it does | Local | Hosted |
|---|---|---|---|
lookup_ip | One IPv4 or IPv6 address. Optional get field filter, for example geoLocation,security. | ✓ | ✓ |
lookup_bulk | 1 to 100 addresses in one call. Results come back in data.responseArray. | ✓ | ✓ |
lookup_me | The public IP of the machine running the server. | ✓ | — |
lookup_me isn’t offered on the hosted server: there it would look up the hosted server’s own address, not yours.
Local or hosted?
Section titled “Local or hosted?”There are two ways to run the server, from one codebase:
- Local (npm package). Runs on your machine over stdio. Your key stays on your machine as an environment variable. Works in every client, including Claude Desktop.
- Hosted (
https://mcp.ipwho.org/mcp). Nothing to install. You send your key in a header on every request. Works in Claude Code, Cursor and VS Code today. Claude Desktop and claude.ai custom connectors expect OAuth sign-in rather than a pasted key, so use the local package there for now.
If in doubt, start local. Both talk to the same API with the same key and the same quotas.
Local setup (npm package)
Section titled “Local setup (npm package)”The server reads your key from the IPWHO_API_KEY environment variable. Node.js 18 or later is required. Replace YOUR_KEY with your IPWho API key.
claude mcp add ipwho --env IPWHO_API_KEY=YOUR_KEY -- npx -y @ipwho/mcp-serverSettings → Developer → Edit Config opens claude_desktop_config.json. Add the server and restart Claude Desktop.
{ "mcpServers": { "ipwho": { "command": "npx", "args": ["-y", "@ipwho/mcp-server"], "env": { "IPWHO_API_KEY": "YOUR_KEY" } } }}~/.cursor/mcp.json for all projects, or .cursor/mcp.json inside one project.
{ "mcpServers": { "ipwho": { "command": "npx", "args": ["-y", "@ipwho/mcp-server"], "env": { "IPWHO_API_KEY": "YOUR_KEY" } } }}.vscode/mcp.json. VS Code asks for the key once and stores it securely, so it never sits in the file.
{ "inputs": [ { "type": "promptString", "id": "ipwho-key", "description": "IPWho API key", "password": true } ], "servers": { "ipwho": { "type": "stdio", "command": "npx", "args": ["-y", "@ipwho/mcp-server"], "env": { "IPWHO_API_KEY": "${input:ipwho-key}" } } }}Hosted setup
Section titled “Hosted setup”The hosted server lives at https://mcp.ipwho.org/mcp and uses the Streamable HTTP transport. Send your key in a header on every request, either X-API-Key: YOUR_KEY or Authorization: Bearer YOUR_KEY. Without a key it returns 401. A key in the URL is refused, so it can’t leak into logs or history.
claude mcp add --transport http ipwho https://mcp.ipwho.org/mcp --header "X-API-Key: YOUR_KEY"~/.cursor/mcp.json:
{ "mcpServers": { "ipwho": { "url": "https://mcp.ipwho.org/mcp", "headers": { "X-API-Key": "YOUR_KEY" } } }}.vscode/mcp.json, with the same inputs block as the local setup:
{ "inputs": [ { "type": "promptString", "id": "ipwho-key", "description": "IPWho API key", "password": true } ], "servers": { "ipwho": { "type": "http", "url": "https://mcp.ipwho.org/mcp", "headers": { "X-API-Key": "${input:ipwho-key}" } } }}Claude Desktop’s custom connectors expect OAuth sign-in rather than a header, and the IPWho server doesn’t accept a key in the URL. Use the local setup above in Claude Desktop. OAuth sign-in is planned.
Try it
Section titled “Try it”Once the server is connected, ask your agent in plain language. Some prompts that map directly to the tools:
- “Where is 8.8.8.8, and what timezone is it in?”
- “Which ISP and ASN does 1.1.1.1 belong to?”
- “Look up these IPs from my access log and group them by country.” (the agent uses
lookup_bulk, up to 100 per call) - “What’s my public IP and who’s my ISP?” (local package only, via
lookup_me)
What you get back
Section titled “What you get back”Each tool returns two things. First, the API’s JSON unchanged: { "success": true, "data": { … } }, with the objects geoLocation, timezone, flag, currency, connection, security and userAgent. Field names keep their exact wire casing (postal_Code, flag_Icon, asn_number); see the full response reference. Second, a one-line attribution, Data source: IPWho (https://www.ipwho.org), and the tool descriptions ask the agent to name IPWho as the source.
Limits to know about
Section titled “Limits to know about”The tool descriptions tell the agent these too, so it can caveat its own answers:
- IP geolocation is approximate, especially at city level. Many fields can be
null;regionandcityoften are. Country is the reliable level. connection.connection_typeisCable/DSL,Cellular,Corporate,Satelliteornull.Corporatealso covers offices, universities, VPNs and cloud networks, so it isn’t datacenter detection.securityis a basic signal:isVpnandisTor(true/false) andisThreat(low,mediumorhigh). It isn’t a fraud or risk score.- Only JSON is returned. The API’s XML and CSV formats aren’t exposed.
- Bulk lookups take at most 100 addresses per call. Your plan’s daily quota and the burst limit of 100 requests a second apply; see rate limits.
Your key
Section titled “Your key”- It’s sent to
api.ipwho.orgonly, in theX-API-Keyheader, never in a URL. - It’s never logged or echoed back in error messages.
- The hosted server is stateless: it keeps no sessions and stores nothing. Each request carries its own key, which is used for that request only.
Other ways to integrate
Section titled “Other ways to integrate”- Writing code? There are official SDKs in 10+ languages, or call the REST API directly.
- Automating without code? See the n8n guide.
- Found a problem or want another tool exposed? Open an issue on GitHub.