location-mcp
The location-mcp server gives LLMs geolocation awareness by providing tools to look up IP addresses, reverse geocode coordinates, and detect the host's public IP — no API key required by default.
geolocate_ip(ip?, format?): Look up detailed geolocation data for any IPv4/IPv6 address, including country, city, region, latitude/longitude, timezone, ISP, currency, ASN, and threat signals (VPN, proxy, Tor, datacenter detection). If no IP is provided, it auto-detects and geolocates the host's own public IP.reverse_geocode(latitude, longitude, format?): Convert a latitude/longitude pair into a human-readable address with details like city, region, country, postal code, and timezone. Powered by Nominatim (OpenStreetMap).get_my_ip(format?): Detect and return the public IP address of the machine running the MCP server.
All tools support a format parameter: "text" (default, human-readable summary) or "json" (raw structured data).
Additional highlights:
Works out of the box using ipapi.is and Nominatim; optionally set
LOCATION_MCP_API_KEYfor better rate limits via ipinfo.io.In-memory caching: IP results cached for 24 hours, reverse geocode results for 7 days.
Provides reverse geocoding capabilities using OpenStreetMap data via the Nominatim API.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@location-mcp Where is 8.8.8.8 located?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Location MCP Server
A Model Context Protocol (MCP) server that gives LLMs geolocation awareness: look up an IP, reverse geocode a coordinate pair, and detect the host's public IP. No API keys required out of the box.
Powered by ipapi.is, Nominatim (OpenStreetMap), and optionally ipinfo.io.
Tools
geolocate_ip(ip?, format?)— Look up geolocation data for an IPv4/IPv6 address (country, city, region, latitude/longitude, timezone, ISP, currency, etc.). Ifipis omitted, automatically detects the public IP of the host.reverse_geocode(latitude, longitude, format?)— Reverse geocode a coordinate pair into a human-readable address (city, region, country, postal code, country code, timezone).get_my_ip(format?)— Detect and return the public IP address of the host running this MCP server.
All tools accept an optional format parameter: "text" (default, human-readable summary) or "json" (raw structured data for further processing).
Related MCP server: IP Geolocation MCP Server
Examples
Look up an IP
"Where is IP 8.8.8.8 located?"
Returns:
IP address: 8.8.8.8
Location: Mountain View, California, United States
Postal code: 94043
Coordinates: 37.4056, -122.0775
Timezone: America/Los_Angeles
UTC offset: -07:00
ISP: Google LLC
Currency: USD
In EU: false
Continent: NA
Source: ipapi.is
Detect the host's public IP
"What's the public IP of the machine running this server?"
Returns:
The public IP of the host is 203.0.113.42.
Reverse geocode coordinates
"What's at 40.7128, -74.0060?"
Returns:
Address: New York City Hall, 260, Broadway, Tribeca, Lower Manhattan, Manhattan, New York County, New York, 10007, United States
Postal code: 10007
Coordinates: 40.7128, -74.006
Timezone: America/New_York
Source: nominatim.openstreetmap.org
Get raw JSON
Request format: "json" to receive the underlying structured data:
{
"ip": "8.8.8.8",
"latitude": 37.4056,
"longitude": -122.0775,
"city": "Mountain View",
"region": "California",
"country": "United States",
"country_code": "US",
"postal_code": "94043",
"timezone": "America/Los_Angeles",
"utc_offset": "-07:00",
"is_dst": true,
"isp": "Google LLC",
"company_name": "Google LLC",
"company_domain": "google.com",
"asn": 15169,
"currency_code": "USD",
"calling_code": "1",
"is_eu": false,
"continent": "NA",
"accuracy": "HIGH",
"is_datacenter": true,
"is_vpn": true,
"is_proxy": false,
"is_tor": false,
"is_mobile": false,
"source": "ipapi.is"
}Installation
Option 1: Via npx (no install, recommended)
npx -y location-mcpThis downloads and runs the bundled server on demand — no global install, no node_modules.
Option 2: Via npm globally
npm install -g location-mcpThen point your MCP client at the absolute path of the location-mcp binary (e.g. which location-mcp).
Configuration
Optional: Use ipinfo.io (better rate limits)
By default, this server uses ipapi.is (keyless) for IP lookups and Nominatim (OpenStreetMap, keyless) for reverse geocoding.
To upgrade to ipinfo.io for IP lookups (their own free tier or paid production token), set the LOCATION_MCP_API_KEY environment variable to your ipinfo.io token before starting the server:
export LOCATION_MCP_API_KEY=your_ipinfo_token_here
location-mcpReverse geocoding always uses Nominatim (no equivalent in the free ipinfo tier).
Client Configuration
Claude Desktop
Add to your claude_desktop_config.json:
{
"mcpServers": {
"location-mcp": {
"command": "npx",
"args": ["-y", "location-mcp"]
}
}
}For an ipinfo.io upgrade:
{
"mcpServers": {
"location-mcp": {
"command": "npx",
"args": ["-y", "location-mcp"],
"env": {
"LOCATION_MCP_API_KEY": "your_ipinfo_token_here"
}
}
}
}Cursor
Add to your .cursor/mcp.json:
{
"mcpServers": {
"location-mcp": {
"command": "npx",
"args": ["-y", "location-mcp"]
}
}
}Windsurf
Add to your model_config.json:
{
"mcpServers": {
"location-mcp": {
"command": "npx",
"args": ["-y", "location-mcp"]
}
}
}Claude Code
claude mcp add location-mcp -- npx -y location-mcpPrivacy & Limitations
VPN / Tor: The detected public IP is the exit node of any VPN, proxy, or Tor circuit in use by the host. The MCP cannot detect the user's real physical location in that case.
Private / reserved IPs: IPs in private ranges (e.g.,
192.168.x.x,10.x.x.x,127.0.0.1) and reserved ranges cannot be geolocated. The server returns a clear error.Rate limits: Keyless tier (ipapi.is) is suitable for light/personal use. For high-volume production use, configure an ipinfo.io API key.
Caching: Results are cached in-memory for 24 hours (IP) and 7 days (reverse geocode). The cache is not persisted across server restarts. The cache is also process-local — no data is shared between MCP instances.
No data persistence: The server does not log, store, or forward IP addresses beyond the in-memory cache.
Attribution
This MCP server wraps the following third-party services:
ipapi.is — IP address geolocation (free tier, keyless, with VPN/Tor/Proxy detection and company data). Used by default for IP lookups.
Nominatim — Reverse geocoding (OpenStreetMap project). © OpenStreetMap contributors. Used for
reverse_geocode.ipinfo.io — IP address geolocation (optional upgrade). Used only when
LOCATION_MCP_API_KEYis set.
Map data from OpenStreetMap is licensed under the Open Database License (ODbL).
Development
# Install dependencies
npm install
# Run in dev mode (hot reload via tsx)
npm run dev
# Lint
npm run lint
npm run lint:fix
# Build (CJS + ESM output)
npm run buildThe build output goes to dist/:
dist/index.cjs— CommonJS bundledist/index.js— ESM bundle (executable,chmod 755)
License
MIT © atorresg
Available Tools
3 toolsgeolocate_ipB
Look up geolocation data for an IP address (country, city, region, latitude, longitude, timezone, ISP, currency, etc.). If no IP is provided, automatically detects the public IP of the host running this server and geolocates that.
Inputs: ip, format.
get_my_ipA
Detect and return the public IP address of the host running this MCP server. Useful when the LLM needs to know the public-facing IP of the machine it is operating on.
Inputs: format.
reverse_geocodeA
Reverse geocode a latitude/longitude pair into a human-readable address with administrative details (city, region, country, postal code, country code, etc.).
Inputs: latitude (required), longitude (required), format.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 3 tools
Each tool has a distinct purpose: IP geolocation, host IP detection, and reverse geocoding. No ambiguity or overlap.
All tool names follow a consistent verb_noun pattern in snake_case, making them predictable and clear.
Three tools cover essential location operations without being excessive or insufficient for a focused location server.
Core operations are present, but forward geocoding (address to coordinates) is missing, which is a notable gap for a location service.
Maintenance
Related MCP Connectors
IPStack MCP Adapter turns IPStack's REST APIs into Model Context Protocol tools so any MCP-compatible client can call them directly in conversation. The first release ships IPStack IP geolocation and security lookups (single IP, caller's IP, and bulk). Additional APILayer services are added by registering them in a single config file, so the catalog grows without client-side changes.
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
A Model Context Protocol server for Wix AI tools
Enable secure connectivity between Sentry issues and debugging data, and LLM clients, using a Model Context Protocol (MCP) server.
Related MCP Servers
- AlicenseAqualityBmaintenanceA Model Context Protocol server that provides LLM Agents with a comprehensive toolset for IP geolocation, network diagnostics, system monitoring, cryptographic operations, and QR code generation.5454 npm20Apache 2.0
- AlicenseAqualityFmaintenanceA Model Context Protocol server that retrieves detailed geographic information about IP addresses using the ipinfo.io API, helping determine user location and network details.525 PyPI45MIT
- AlicenseAqualityFmaintenanceA Model Context Protocol server that provides geocoding services by integrating with the Nominatim API, allowing AI assistants to perform location-based lookups.2491 npm3MIT
- FlicenseNot gradedqualityDmaintenanceAn MCP (Multi-Agent Conversation Protocol) server that enables natural language interaction with the AbstractAPI geolocation service, allowing users to retrieve geographic information about IP addresses.-