How to use IP2Location.io MCP server?

The Model Context Protocol (MCP) server is a lightweight communication interface designed to manage and coordinate AI model execution within a structured runtime environment. It acts as a standardized interface connecting language models with external tools, plugins, or services, allowing for dynamic interaction and real-time context handling. An MCP server helps to improve the model performance in complex or multi-step tasks. This helps the developers in building an application that is intelligent, extensible and well integrated with various data sources.

IP2Location.io MCP server is designed to serve the geolocation information of an IP address in the MCP client. In this tutorial, we are going to show how to use the IP2Location.io MCP server in Claude Desktop to get the geolocation information of an IP address.

Prerequisites

This tutorial will use Claude Desktop for the demonstration. You can download it here if you haven’t installed it yet. For Linux user, kindly visit this guide for creating a custom client as Antrophic has yet to release for Linux.

The IP2location.io MCP server works in the Python environment with the uv package manager, you can follow this guide to learn how to install it. The IP2location.io MCP server works best with an API key. You can sign up for a free API key to unlock a higher query limit and richer geolocation information.

Steps to setup the IP2Location.io MCP server in Claude Desktop

  1. Download the latest release of the IP2Location.io MCP server from the repo.
  2. If you did not installed uv package manager before, kindly install it by following this guide.
  3. If you did not installed Claude Desktop before, kindly install it by downloading the installer from here for Windows and MacOS users, or visit this guide for creating a custom client for Linux user.
  4. Open the claude_desktop_config.json file in your favorite editor. If you do not have the file in your local, read this guide to learn how to create one in your local.
  5. Add the following code to the file and save it (Remember to replace the /path/to/ip2locationio/ with the actual path to the IP2Location.io MCP server in your local).
{
  "mcpServers": {
    "ip2locationio": {
      "command": "uv",
      "args": [
        "--directory",
        "/path/to/ip2locationio/src",
        "run",
        "server.py"
      ],
      "env": {
        "IP2LOCATION_API_KEY": "<YOUR API key HERE>"
      }
    }
  }
}
  1. If you wish to query with your IP2Location.io API key, kindly replace the <YOUR API key HERE> with your actual API key too.
  2. Restart the Claude Desktop after saving the changes, and you should see it appear in the Search and tools menu.

How to use the IP2Location.io MCP server in Claude Desktop?

To use the IP2Location.io MCP server, just ask for an IP address in the new chat. For instance, below is the screenshot of an example of querying the 8.8.8.8:

If you encountered the following dialog, kindly choose either Allow always or Allow once:

Was this article helpful?

Related Articles