Back to MCP Catalog

GeoPy Geocoding MCP Server

Location ServicesPython
Geocoding service for converting addresses to coordinates and vice versa
Available Tools

geocode_location

Converts an address or place name to latitude, longitude, and formatted address

reverse_geocode

Converts latitude and longitude coordinates to the nearest address

geocode_with_details

Returns detailed geocoding information including bounding boxes and address components

geocode_multiple_locations

Geocodes a list of addresses, returning coordinates and formatted addresses for each

reverse_geocode_multiple_locations

Converts multiple coordinate pairs to their corresponding addresses

distance_between_addresses

Calculates the distance between two addresses in miles or kilometers

distance_between_coords

Calculates the distance between two coordinate pairs in miles or kilometers

GeoPy Geocoding provides a comprehensive set of geocoding tools for Large Language Models. It leverages the GeoPy library to convert between addresses and geographic coordinates, calculate distances between locations, and retrieve detailed location information. With support for multiple geocoding providers including Nominatim (OpenStreetMap), ArcGIS, and Bing Maps, this MCP enables models to work with geographic data in a flexible and powerful way. The server includes built-in safety features like rate limiting to prevent excessive requests to geocoding services.

Installation

Prerequisites

  • Python 3.6 or higher
  • uv package manager (recommended)

Installation Options

Option 1: Install for Claude Desktop

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

Option 2: Manual Installation

  1. Clone the repository:
git clone https://github.com/webcoderz/MCP-Geo.git
cd MCP-Geo
  1. Install dependencies:
uv sync
  1. Add the following configuration to your MCP settings file:
{
    "mcp-geo": {
        "command": "uv",
        "args": [
            "--directory",
            "PATH_TO_MCP_GEO_DIRECTORY",
            "run",
            "geo.py"
        ],
        "env": {
            "NOMINATIM_URL": "${NOMINATIM_URL}",
            "SCHEME": "http",
            "GEOCODER_PROVIDER": "nominatim"
        }
    }
}

Replace PATH_TO_MCP_GEO_DIRECTORY with the actual path to the MCP-Geo directory on your system.

Configuration

The server can be configured using environment variables:

| Variable | Description | Default | |----------|-------------|---------| | GEOCODER_PROVIDER | Geocoding service provider ("nominatim", "arcgis", or "bing") | nominatim | | NOMINATIM_URL | Domain for Nominatim | nominatim.openstreetmap.org | | SCHEME | Protocol (http/https) | http | | ARC_USERNAME | ArcGIS username (required for ArcGIS) | None | | ARC_PASSWORD | ArcGIS password (required for ArcGIS) | None | | BING_API_KEY | Bing Maps API key (required for Bing) | None |

These variables can be set in your shell environment or in the MCP settings file.

Usage Examples

Converting an address to coordinates

I need to find the latitude and longitude of the Empire State Building in New York.

Finding an address from coordinates

What's the address at coordinates 40.7128, -74.0060?

Calculating distance between locations

How far is it from Los Angeles to San Francisco in miles?

Safety Features

  • Rate Limiting: Each geocoding call is rate-limited to avoid excessive requests that might violate usage limits of geocoding services.
  • Error Handling: The server catches exceptions from geocoding services and returns safe results instead of crashing.

Switching Geocoding Providers

By default, the server uses Nominatim (OpenStreetMap) as the geocoding provider. To use a different provider:

  1. Set the GEOCODER_PROVIDER environment variable to "arcgis" or "bing"
  2. Provide the necessary credentials for the chosen provider:
    • For ArcGIS: Set ARC_USERNAME and ARC_PASSWORD
    • For Bing Maps: Set BING_API_KEY

Related MCPs

Google Maps
Location ServicesTypeScript

Access Google Maps API functionality for geocoding, place search, directions, and more

IP Geolocation
Location ServicesPython

Get detailed geolocation information about IP addresses

QGIS Desktop
Location ServicesPython

Control QGIS Desktop GIS software through Claude AI

About Model Context Protocol

Model Context Protocol (MCP) allows AI models to access external tools and services, extending their capabilities beyond their training data.

Generate Cursor Documentation

Save time on coding by generating custom documentation and prompts for Cursor IDE.