home / mcp / whereami mcp server

WhereAmI MCP Server

A lightweight mcp server that tells you exactly where you are.

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "kukapay-whereami-mcp": {
      "command": "python",
      "args": [
        "whereami_mcp.py"
      ]
    }
  }
}

WhereAmI MCP Server is a lightweight Python-based service that determines your current location from your IP address using ipapi.co. It exposes a simple MCP interface to fetch specific location details and generate a comprehensive location report, making it easy to integrate location-aware behavior into your MCP workflows.

How to use

You interact with WhereAmI through an MCP client to fetch exact location details or to generate a full geolocation report. Use the location resource to read individual fields, or invoke the location-report tool to get a complete Markdown table with key data such as IP, country, city, latitude, longitude, timezone, ISP, and ASN. You can trigger a detailed report by asking for a full location report when you query with the predefined prompt.

How to install

Prerequisites you need before installing are Python 3.10 or newer and pip.

Step 1: Install the MCP client and HTTP utilities.

pip install mcp httpx

Step 2: Install WhereAmI as an MCP service (optional). This registers the server under MCP with a friendly name.

mcp install whereami_mcp.py --name "WhereAmI"

Step 3: Run the server directly for development or testing.

python whereami_mcp.py

Step 4: For development workflows, you can start the MCP server in development mode.

mcp dev whereami_mcp.py

Additional setup notes

If you plan to run the server locally, ensure your environment can reach ipapi.co, as location resolution relies on that service for IP-based data.

Configuration and usage details

WhereAmI exposes two main interfaces for MCP clients:

Resource: location://{type} reads a specific piece of location data. Supported types include ip, country, country_code, region, city, latitude, longitude, timezone, isp, and asn.

Tool: get_location() produces a detailed Markdown table with the following fields: IP, Country, Country Code, Region, City, Latitude, Longitude, Timezone, ISP, ASN.

Prompt: where_am_i_prompt is a predefined query that triggers get_location() to return a full report.

Troubleshooting and notes

The server handles API or network errors gracefully. If the location data cannot be retrieved due to connectivity issues, you will receive a clear error message indicating the problem and potential remediation steps.

Security and runtime considerations

Limit exposure of local endpoints when running in shared environments. Prefer secure channels and avoid exposing the MCP server to untrusted networks without appropriate access controls.

Available tools

location

Resource to fetch a specific piece of location data. Use the type parameter to request items like ip, country, city, latitude, longitude, or isp.

get_location

Tool that generates a comprehensive Markdown table with geolocation data including IP, country, region, city, coordinates, timezone, ISP, and ASN.

where_am_i_prompt

Predefined prompt that triggers get_location() to produce a full location report.