
WhereAmI MCP Server
A lightweight mcp server that tells you exactly where you are.
What is WhereAmI MCP Server?
WhereAmI MCP Server is a lightweight server that provides geolocation information based on the user's current IP address, utilizing the ipapi.co service.
How to use WhereAmI MCP Server?
To use the server, clone the repository, install the required dependencies, and run the server. You can query your location using predefined commands or natural language prompts.
Key features of WhereAmI MCP Server?
- Dynamic resource fetching for specific location data (IP, country, city, etc.) via
location://{type}
. - Comprehensive location reports generated with
get_location()
. - Natural language querying capability with prompts like "Where am I?".
- Robust error handling for API and network issues.
- Minimal dependencies required for setup.
Use cases of WhereAmI MCP Server?
- Determining the user's current IP address and location.
- Fetching detailed geolocation data for applications.
- Integrating location services into other applications or services.
FAQ from WhereAmI MCP Server?
- Can I use WhereAmI MCP Server for any IP address?
Yes! It provides location data based on the current IP address.
- Is there a cost associated with using WhereAmI MCP Server?
No, it is free to use under the MIT License.
- What programming language is used for WhereAmI MCP Server?
The server is built using Python.
WhereAmI MCP Server
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
andhttpx
.
Installation
Prerequisites
- Python 3.10+
pip
Setup
- Clone the repository:
git clone https://github.com/kukapay/whereami-mcp.git cd whereami-mcp
- Install dependencies:
pip install mcp httpx
- (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
location://{type}
Resource: 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"
get_location()
Tool: 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 |
where_am_i_prompt
Prompt: Predefined query: "Please tell me where I am based on my current IP address." Triggers get_location()
.
Examples in Claude Desktop
- Install the server:
mcp install whereami_mcp.py --name "WhereAmI"
- Query data:
- "My IP is
@location://ip
" - "I’m in
@location://city
,@location://country
"
- "My IP is
- Get full report:
- "Where am I?"
get_location()
License
MIT License. See LICENSE for details.