# Ip2Location — how to use (mcp.ai)

Connect your Ip2Location account and use 8 tools for developer tools straight from your AI agent. Connect with your own API key. IP2Location.io provides fast and accurate IP geolocation data, including country, city, ISP, latitude, longitude, and more, supporting both IPv4 and IPv6 lookups.

## Option A — via MCP (recommended)
Remote MCP endpoint (HTTP, streamable): `https://api.mcp.ai/p_ip2location?ms=1787295720000`
Add it as a custom/remote MCP connector in your client (Claude, Cursor, VS Code…), then authenticate when prompted. Once connected, ask the agent to use the server's tools (e.g. `ip2location_bulk_ip_geolocation`).

## Option B — via direct REST API
Base URL: `https://api.mcp.ai/api/ip2location`
Auth: `Authorization: Bearer sk_live_…` — create a workspace API key at https://mcp.ai/settings/api-keys
Discover endpoints: `GET https://api.mcp.ai/api/ip2location/_endpoints`

### Endpoints
- `POST https://api.mcp.ai/api/ip2location/bulk/ip/geolocation` — Retrieve geolocation information for multiple IP addresses in a single request. Supports batch processing of 1-1000 IPv4 or IPv6 addresses with flexible output formats (JSON or CSV) and customizable f
  - body: { ips: string[], fields?: string[], format?: string }
- `POST https://api.mcp.ai/api/ip2location/check/credits` — Tool to check remaining IP2Location API credits. Use after setting up authentication to monitor usage.
  - body: { key?: string }
- `POST https://api.mcp.ai/api/ip2location/distance` — Calculate the great-circle distance between two IP addresses based on their geographic locations. This tool looks up the geolocation (latitude/longitude) for each IP address and calculates the shortes
  - body: { ip1: string, ip2: string }
- `POST https://api.mcp.ai/api/ip2location/get/hosted/domains` — Retrieves a list of domain names hosted on a specific IP address (IPv4 or IPv6). Use this tool when you need to: - Discover which domains are hosted on a particular IP - Investigate shared hosting env
  - body: { ip: string, key: string, page?: integer, format?: string }
- `POST https://api.mcp.ai/api/ip2location/get/ip/geolocation` — Tool to retrieve geolocation data for an IP address. Use when detailed IP location info is needed.
  - body: { ip: string, lang?: string, addon?: string[], format?: string, package: string }
- `POST https://api.mcp.ai/api/ip2location/get/proxy/detection` — Tool to detect if an IP is a proxy, VPN, or TOR exit node. Use when verifying anonymizing services.
  - body: { ip: string, check?: integer, package?: string }
- `POST https://api.mcp.ai/api/ip2location/ip2/whois/domain/whois` — Tool to retrieve WHOIS information for a domain. Use when you need domain registration details.
  - body: { domain: string, format?: string }
- `POST https://api.mcp.ai/api/ip2location/list/ips` — Tool to list a curated set of test IPv4 and IPv6 addresses. Use when sample IPs are needed for IP2Location or IP2Proxy lookups during development or testing.
  - body: { type?: string }

## Example prompts
- "What can I do in Ip2Location?"
- "Show me a summary of my Ip2Location account"

## More
- Page: https://mcp.ai/ip2location
- Agent spec (llms.txt): https://mcp.ai/ip2location/llms.txt
- Postman collection: https://mcp.ai/ip2location/postman.json
