Skip to main 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
    
  2. Install dependencies:
    pip install mcp httpx
    
  3. (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.

Metadata

Release files for whereami-mcp 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for whereami-mcp 0.1.0
File Size Uploaded
whereami_mcp-0.1.0.tar.gz 4.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for whereami-mcp 0.1.0
File Interpreter ABI Platform
whereami_mcp-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 9.2 kB

Release files / whereami_mcp-0.1.0.tar.gz

Download URL whereami_mcp-0.1.0.tar.gz
Size 4.3 kB
Tags Source
SHA-256 checksum
How to use checksums
5b169dc73b4d04a79f1bd6c98ed6b544005142ba9103e160409416c5905d5c2f
BLAKE2b-256 checksum
How to use checksums
94ffa6c3ea614ab0cb4a123c2ae521941886b675f28c3304c805e8ab6047299e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.6.9

Release files / whereami_mcp-0.1.0-py3-none-any.whl

Download URL whereami_mcp-0.1.0-py3-none-any.whl
Size 4.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9b673386d74ba60e4c6b469593410fe753dbf8288753d5be8caf360c0a0facfb
BLAKE2b-256 checksum
How to use checksums
39251efc35a15dfbd59a14d92e719a1474fcae424cf33406e3d1b2978f3fab1a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.6.9

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page