Navigation
WhereAmI MCP Server: Precision Geolocation, Ultra-Lightweight - MCP Implementation

WhereAmI MCP Server: Precision Geolocation, Ultra-Lightweight

Pinpoint your location with precision using our ultra-lightweight MCP server – seamless integration for real-time geolocation that works exactly where you need it." )

Location Services
4.4(169 reviews)
253 saves
118 comments

This tool saved users approximately 8214 hours last month!

About WhereAmI MCP Server

What is WhereAmI MCP Server: Precision Geolocation, Ultra-Lightweight?

WhereAmI MCP Server is a lightweight geolocation service built for developers needing precise IP-based location data. Leveraging the ipapi.co API, it provides real-time geolocation insights through streamlined resources and tools, all while maintaining minimal dependencies. Perfect for applications requiring quick setup and on-demand location queries.

Key Features of WhereAmI MCP Server: Precision Geolocation, Ultra-Lightweight?

  • Dynamic Resource Access: Retrieve specific geolocation data (IP, city, country, coordinates) via intuitive endpoints.
  • Comprehensive Reporting: Generate detailed location reports using the built-in tool for structured outputs.
  • Natural Language Queries: Support for human-readable commands to fetch data effortlessly.
  • Robust Error Handling: Built-in safeguards to manage API timeouts or invalid requests gracefully.
  • Zero-Overhead Dependency: Only requires Python and standard libraries—no bulky frameworks.

WhereAmI MCP Server Features

How to Use WhereAmI MCP Server

Installation is straightforward and involves three quick steps:

  1. git clone https://github.com/whereami-mcp (or your repo URL)
  2. pip install -r requirements.txt
  3. python server.py to start the service

Once running, access data via:

# Example: Get current IP location
curl http://localhost:5000/api/v1/location

Real-World Use Cases

Developers use WhereAmI in scenarios like:

  • Geotargeting content in web applications
  • Automating region-based user authentication
  • Building analytics dashboards with location metadata

For instance, in a Claude Desktop workflow, simply run:

curl -X POST 'http://api.whereami:5000/report' -d '{"ip":"8.8.8.8"}'

WhereAmI MCP Server FAQ

Frequently Asked Questions

  • Q: How do I handle API rate limits?
    A: Use the max_requests config parameter in server.py.
  • Q: Can I customize output formats?
    A: Yes—extend the response_formatter module to add JSON/XML support.
  • Q: What if the API becomes unavailable?
    A: The service caches last-known data for critical fields during outages.

Content

WhereAmI MCP Server

Python License Status

A lightweight mcp server that tells you exactly where you are based on your current IP, powered by ipapi.co.

Features

  • Dynamic Resources : Fetch specific data (e.g., IP, country, city) via location://{type}.
  • Detailed Tool : Generate a comprehensive location report with get_location().
  • Natural Language Prompt : Ask "Where am I?" to get detailed results.
  • Robust Error Handling : Gracefully manages API and network issues.
  • Minimal Dependencies : Requires only mcp and httpx.

Installation

Prerequisites

  • Python 3.10+
  • pip

Setup

  1. Clone the repository:

    git clone https://github.com/kukapay/whereami-mcp.git

cd whereami-mcp
  1. Install dependencies:

    pip install mcp httpx

  2. (Optional) Install as an MCP service:

    mcp install whereami_mcp.py --name "WhereAmI"

Usage

Running the Server

  • Direct execution:

    python whereami_mcp.py
    
  • Development mode:

    mcp dev whereami_mcp.py
    

Components

Resource: location://{type}

Returns a specific location detail based on {type}.

  • Supported Types : ip, country, country_code, region, city, latitude, longitude, timezone, isp, asn
  • Examples :
    • @location://ip"8.8.8.8"
    • @location://city"Mountain View"
    • @location://country"United States"

Tool: get_location()

Generates a detailed Markdown table of geolocation data.

  • Fields :

    • IP
    • Country
    • Country Code
    • Region
    • City
    • Latitude
    • Longitude
    • Timezone
    • ISP
    • ASN
  • Sample Output :

    | Field          | Value             |
    

    |----------------|-------------------|
    | IP | 8.8.8.8 |
    | Country | United States |
    | Country Code | US |
    | Region | California |
    | City | Mountain View |
    | Latitude | 37.4223 |
    | Longitude | -122.0848 |
    | Timezone | America/Los_Angeles |
    | ISP | GOOGLE |
    | ASN | AS15169 |

Prompt: where_am_i_prompt

Predefined query: "Please tell me where I am based on my current IP address." Triggers get_location().

Examples in Claude Desktop

  1. Install the server:

    mcp install whereami_mcp.py --name "WhereAmI"

  2. Query data:
    * "My IP is @location://ip"
    * "I’m in @location://city, @location://country"

  3. Get full report:
    * "Where am I?"
    * get_location()

License

MIT License. See LICENSE for details.

Related MCP Servers & Clients