Get the FREE Ultimate OpenClaw Setup Guide →

mcp-ip2location-io

IP Geolocation MCP server using IP2Location.io API

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio ip2location-mcp-ip2location-io uv --directory /path/to/ip2locationio/src run server.py \
  --env IP2LOCATION_API_KEY="<YOUR API key HERE>"

How to use

This MCP server exposes IP geolocation data by querying the IP2Location.io API. It runs as a FastMCP-compatible tool named get_geolocation, which takes a single parameter: ip (a string IPv4 or IPv6 address). When invoked, it returns a JSON string containing a wide range of geolocation, network, and security details such as country, region, city, latitude, longitude, ASN, ISP, proxy information, and more. It supports both unsigned queries (limited to 1,000 per day) and API-key authenticated queries (up to 50,000 per month) depending on whether you provide an API key. To use it, connect your MCP-enabled client (for example Claude Desktop) to the ip2locationio MCP server, then call get_geolocation with the target IP. The server will relay the request to IP2Location.io and return the resulting data.

Typical usage flow: install uv and connect to Claude Desktop (or your MCP client), configure the ip2locationio MCP server in your client configuration, and then run get_geolocation with an IP such as 8.8.8.8. The response will include location, network details, and proxy information as provided by IP2Location.io.

How to install

Prerequisites:

  • A supported environment with Python and the uv package manager installed (per the MCP Quickstart guide).
  • An IP2Location.io API key (optional if you want higher rate limits).
  • Access to Claude Desktop (for using the provided Claude integration) or your preferred MCP client.

Installation steps:

  1. Install uv according to the MCP quickstart guide

  2. Prepare the IP2Location MCP server files

    • Clone or download the IP2Location MCP server repository and place it at a directory such as /path/to/ip2locationio/src
    • Ensure server.py is in the src directory and is configured to use the IP2LOCATION_API_KEY if provided
  3. Configure your environment (optional API key)

    • If you have an API key, export or set it in the environment configuration for your MCP client or runtime:
      • IP2LOCATION_API_KEY=<YOUR_API_KEY>
  4. Run the MCP server locally via uv

    • Use the following command (adjust paths as needed): uv --directory /path/to/ip2locationio/src run server.py
  5. Integrate with Claude Desktop or your MCP client

    • Add the ip2locationio MCP server to your claude_desktop_config.json (as shown in the README example) and restart Claude Desktop.
  6. Test the setup

    • Call get_geolocation with an IP such as 8.8.8.8 and verify you receive a JSON payload containing location, ASN, ISP, proxy status, and other fields.

Additional notes

Notes and tips:

  • If you omit an API key, IP2Location.io will allow up to 1,000 queries per day. Providing an API key increases the quota significantly.
  • Ensure the IP2LOCATION_API_KEY is kept secret and not exposed in public configurations.
  • The get_geolocation tool returns a JSON string; downstream clients should parse it accordingly to extract fields like country, city, latitude/longitude, ASN, ISP, proxy type, and threat indicators.
  • If you encounter rate limiting, consider upgrading your IP2Location.io plan or caching common queries on the client side.
  • Path placeholders like /path/to/ip2locationio/src should be replaced with your actual deployment path.

Related MCP Servers

Sponsor this space

Reach thousands of developers