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 "Install 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-mcpWhere 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.
| Name | Required | Description | Default |
|---|---|---|---|
| ip | No | The IPv4 or IPv6 address to look up. If omitted, the server auto-detects its own public IP. | |
| format | No | Output format. "text" returns a human-readable summary; "json" returns the raw structured data. | text |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description must fully disclose behavioral traits. It mentions auto-detection and the data fields but omits critical details such as whether the operation is read-only, any error handling for invalid IPs, rate limits, or external service dependencies. This lack of depth reduces transparency.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is two sentences long, directly stating the tool's purpose and a key behavioral note about auto-detection. Every sentence adds value with no unnecessary wording.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's simplicity (2 parameters, no output schema, no nested objects), the description covers the essential functionality and auto-detection. However, it lacks details about data sources, accuracy, or privacy implications, leaving the agent with unanswered questions for a geolocation service.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema already describes both parameters (ip and format) with 100% coverage, including the auto-detection behavior for ip. The description reinforces this but adds minimal new semantic value beyond what the schema provides, meriting the baseline score.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states that the tool looks up geolocation data for an IP address and lists the types of data returned. It also mentions auto-detection if no IP is provided. However, it does not differentiate from sibling tools (get_my_ip, reverse_geocode), missing an opportunity to clarify scope.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies usage for geolocation lookups and explicitly notes that omitting the IP triggers auto-detection. It provides no when-not-to-use guidance or explicit comparison to siblings, leaving the agent to infer context.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
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.
| Name | Required | Description | Default |
|---|---|---|---|
| format | No | Output format. "text" returns a human-readable summary; "json" returns the raw structured data. | text |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden. It describes the operation but does not disclose any behavioral traits such as network dependencies, potential latency, or error conditions. While it is not misleading, it lacks additional context beyond the basic functionality.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is extremely concise at two sentences, front-loading the core purpose. Every sentence is informative and there is no extraneous text.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the low complexity of the tool and the complete schema documentation for the parameter, the description provides adequate context. No output schema is present, but the return value is implicitly the IP address, which is sufficient.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100% as the single parameter 'format' is fully described in the schema. The description adds no additional meaning beyond what the schema already provides.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool detects and returns the public IP address of the host. It uses a specific verb ('Detect and return') and resource ('public IP address'), and is well-distinguished from sibling tools like geolocate_ip and reverse_geocode.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description explicitly mentions when the tool is useful ('when the LLM needs to know the public-facing IP'), providing clear context. However, it does not provide explicit exclusions or mention when not to use it.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
reverse_geocodeA
Reverse geocode a latitude/longitude pair into a human-readable address with administrative details (city, region, country, postal code, country code, etc.).
| Name | Required | Description | Default |
|---|---|---|---|
| latitude | Yes | Latitude in decimal degrees. Range: -90 (South) to 90 (North). Example: 40.7128 | |
| longitude | Yes | Longitude in decimal degrees. Range: -180 (West) to 180 (East). Example: -74.0060 | |
| format | No | Output format. "text" returns a human-readable summary; "json" returns the raw structured data. | text |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description must disclose behavioral traits. It indicates the output is a human-readable address with administrative details, adding value beyond the schema. However, it does not mention error handling, result accuracy, rate limits, or authentication requirements. The description is transparent about inputs and output essence but leaves gaps.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, clear sentence that is front-loaded with the action. It avoids unnecessary words and covers the main purpose. It could be slightly more concise, but it is efficient and includes useful detail (list of admin details). No waste.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given no output schema, the description explains the return value (address with admin details). It does not detail exact fields for json vs text, but the format parameter description in the schema partially covers that. For a low-complexity tool, the description is fairly complete, though it could mention error responses or limitations.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, with each parameter documented clearly (latitude range, longitude range, format enum). The description does not add additional meaning to the parameters beyond what the schema already provides. Baseline for high coverage is 3, and the description does not exceed that.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose: reverse geocoding a latitude/longitude pair into a human-readable address with administrative details. The verb 'reverse geocode' is specific and directly conveys the core function. It distinguishes itself from sibling tools (geolocate_ip, get_my_ip) which deal with IP-based location, not coordinates.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies appropriate usage: given coordinates, get an address. It doesn't explicitly state when to use this versus alternatives, but the tool name and description make the context clear. Sibling tools are for IP geolocation, so the differentiation is implicit. No exclusions are provided, but the guidance is sufficient for an AI agent to infer correct usage.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
TDQS
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
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
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
- AlicenseAqualityAmaintenanceA 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.543718Apache 2.0
- AlicenseAqualityBmaintenanceA Model Context Protocol server that retrieves detailed geographic information about IP addresses using the ipinfo.io API, helping determine user location and network details.544MIT
- AlicenseAqualityFmaintenanceA Model Context Protocol server that provides geocoding services by integrating with the Nominatim API, allowing AI assistants to perform location-based lookups.23923MIT
- 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.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/atorresg/location-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server