Skip to main content

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

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mseep_whereami_mcp-0.1.0.tar.gz (3.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mseep_whereami_mcp-0.1.0-py3-none-any.whl (3.3 kB view details)

Uploaded Python 3

File details

Details for the file mseep_whereami_mcp-0.1.0.tar.gz.

File metadata

  • Download URL: mseep_whereami_mcp-0.1.0.tar.gz
  • Upload date:
  • Size: 3.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.12

File hashes

Hashes for mseep_whereami_mcp-0.1.0.tar.gz
Algorithm Hash digest
SHA256 345892b82441c998e12ed035fbe21816566b8410e9daa650c675d09aa4caf8cc
MD5 5b962506af737a280c537e91ea983dad
BLAKE2b-256 c00f2deef56bc3cb509b7988956aac5829d7a0d2d101c89064f197a018531919

See more details on using hashes here.

File details

Details for the file mseep_whereami_mcp-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for mseep_whereami_mcp-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9bb17ca4d5ee41a9a9ac753c0a2c27c7456e6ec4e3d23690945aaaf4dd66bbfa
MD5 5667062227d167d6ea42dcf6af02d8fb
BLAKE2b-256 192f687db15768b6f88123d9e63493c126339ccb694d79b8f4f62a1488ae19f4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page