Fire in da houseTop Tip:Paying $100+ per month for Perplexity, MidJourney, Runway, ChatGPT and other tools is crazy - get all your AI tools in one site starting at $15 per month with Galaxy AI Fire in da houseCheck it out free

MCP-Geo

MCP.Pizza Chef: webcoderz

MCP-Geo is a dedicated MCP server designed to provide geocoding and reverse geocoding capabilities using the GeoPY Python library. It enables applications and AI models to convert addresses into geographic coordinates and vice versa, facilitating location-based queries and spatial data enrichment. Built on the fastmcp framework, MCP-Geo supports Python 3.6+ environments and integrates seamlessly into MCP workflows, enhancing context-aware AI interactions with real-world geographic data. Its lightweight design and dependency management via requirements.txt make it easy to install and deploy in various environments, including Claude Desktop and other platforms.

Use This MCP server To

Convert addresses to geographic coordinates Perform reverse geocoding from coordinates to addresses Enhance AI models with location context Integrate geolocation data into workflows Support location-based query resolution Enable spatial data enrichment for applications

README

MCP-Geo

Geocoding MCP server with GeoPY!

📋 System Requirements

  • Python 3.6+

📦 Dependencies

Install all required dependencies:

# Using uv
uv sync

Required Packages

  • fastmcp: Framework for building Model Context Protocol servers
  • geoPy: Python library for accessing and geocoding/reverse geocoding locations.

All dependencies are specified in requirements.txt for easy installation.

📑 Table of Contents

🛠️ MCP Tools

This MCP server provides the following geocoding tools to Large Language Models (LLMs):

geocode_location

  • Takes a user-provided address or place name and returns the best match’s latitude, longitude, and formatted address.

  • Handles errors gracefully and returns None if the location is not found or if an error occurs.

reverse_geocode

  • Takes a latitude and longitude and returns the nearest address.
  • Useful for finding descriptive information about a point on the map.

geocode_with_details

  • Similar to geocode_location but returns additional data such as bounding boxes and more detailed address info, if supported by the geocoder.

geocode_multiple_locations

  • Accepts a list of address strings and returns a list of geocoding results (lat/lon/address) for each address.
  • Rate-limited to avoid hitting geocoding service quotas.

reverse_geocode_multiple_locations

  • Accepts a list of [lat, lon] pairs to perform reverse geocoding for each.
  • Returns a list of dictionaries containing lat, lon, and address or None for unsuccessful lookups, also rate-limited.

distance_between_addresses

  • Calculate the distance between two addresses or place names.
  • accepts 2 addresses and a unit of measurement (miles/kilometer)
  • Returns the distance in the specified unit, or None if either address could not be geocoded.

distance_between_coords

  • Calculate the distance between two lat/lon pairs.
  • accepts 2 pairs of latitude and longitude and a unit of measurement (kilometer/miles)
  • Returns the distance in the specified unit.

🚀 Getting Started

Clone the repository:

git clone https://github.com/webcoderz/MCP-Geo.git
cd MCP-Geo

📦 Installation Options

You can install this MCP server in either Claude Desktop or elsewhere. Choose the option that best suits your needs.

Option 1: Install for Claude Desktop

Install using FastMCP:

fastmcp install geo.py --name "MCP Geo"

Option 2: Install elsewhere

To use this server anywhere else:

  1. Add the following configuration to the settings file:
{
    "mcp-geo": {
        "command": "uv",
        "args": [
          "--directory",
          "MCP-Geo",
          "run",
          "geo.py"
        ],
        "env": {
        "NOMINATIM_URL": "${NOMINATIM_URL}",
        "SCHEME": "http",
        "GEOCODER_PROVIDER": "nominatim"
        }
    }
}

🔒 Safety Features • Rate Limiting: Each geocoding call is rate-limited (e.g., 1-second delay) to avoid excessive requests that violate usage limits. • Error Handling: Catches geopy exceptions (timeouts, service errors) and returns safe None results instead of crashing.

📚 Development Documentation

If you’d like to extend or modify this server: • Check geo.py for how each tool is implemented and how geopy is integrated. • Adjust environment variables to switch providers (Nominatim, ArcGIS, Bing, etc.). • Look at geopy’s official docs for advanced usage like bounding boxes, language settings, or advanced data extraction.

⚙️ Environment Variables

Configure the server using environment variables:

Variable Description Default
GEOCODER_PROVIDER (optional) "nominatim", "arcgis", or "bing" nominatim
NOMINATIM_URL (optional) Domain for Nominatim nominatim.openstreetmap.org
SCHEME (optional) http/https http
ARC_USERNAME (optional for ArcGIS) ArcGIS username None
ARC_PASSWORD (optional for ArcGIS) ArcGIS password None
BING_API_KEY (required for Bing) Your Bing Maps key. None

These can be set in your shell or in the MCP settings file for your environment. If more are needed just edit geo.py and add them in to whichever geocoder you are using.

MCP-Geo FAQ

How do I install MCP-Geo dependencies?
Install dependencies using 'uv sync' or via the requirements.txt file, including fastmcp and GeoPY.
What Python version is required for MCP-Geo?
MCP-Geo requires Python 3.6 or higher to run properly.
Can MCP-Geo be used outside Claude Desktop?
Yes, MCP-Geo supports installation and use in various environments beyond Claude Desktop.
What geocoding library does MCP-Geo use?
MCP-Geo uses the GeoPY library for geocoding and reverse geocoding services.
How does MCP-Geo ensure safe operation?
MCP-Geo includes safety features as part of its design to handle geocoding requests securely.
Is MCP-Geo compatible with multiple LLM providers?
Yes, MCP-Geo can be integrated with models from OpenAI, Claude, Gemini, and others.
Where can I find development documentation for MCP-Geo?
Development documentation is available in the MCP-Geo GitHub repository README.
How do I start using MCP-Geo after installation?
Follow the Getting Started section in the README for setup and usage instructions.