SuperAPIAI Directory

MCP-Geo

github.com · AI coding

Geocoding via Nominatim, ArcGIS and Bing.

Open website Alternatives
PricingOpen source开源项目(可免费自部署)

About this tool

MCP-Geo is a geocoding MCP server built on GeoPY, designed to provide geocoding-related capabilities for large language models (LLMs). It exposes a series of tools to LLMs through the Model Context Protocol (MCP), enabling them to handle conversion between addresses and coordinates as well as distance calculation.

Purpose

The server is mainly used to convert natural language addresses or place names into geographic coordinates (geocoding), and to convert coordinates into readable addresses (reverse geocoding). In addition, it supports calculating the distance between two addresses or two coordinate points. These capabilities can help LLMs provide more accurate answers in tasks involving location information.

Main Capabilities

MCP-Geo provides the following tools:

  • geocode_location: Accepts an address or place name provided by the user and returns the best-matching latitude, longitude, and formatted address. If not found or an error occurs, returns None.
  • reverse_geocode: Accepts latitude and longitude and returns the nearest address, used to obtain descriptive information for a point on a map.
  • geocode_with_details: Similar to geocode_location, but returns additional data, such as a bounding box and more detailed address information (if supported by the geocoder).
  • geocode_multiple_locations: Accepts a list of address strings and returns a list of geocoding results (latitude/longitude/address) for each address. It has rate limiting to avoid exceeding service quotas.
  • reverse_geocode_multiple_locations: Accepts a list of [latitude, longitude] pairs and performs reverse geocoding on each. Returns a list of dictionaries containing latitude, longitude, and address, or None on failure, also with rate limiting.
  • distance_between_addresses: Calculates the distance between two addresses or place names. Accepts two addresses and a unit of measurement (miles/kilometers) and returns the distance in the specified unit, or None if either address cannot be geocoded.
  • distance_between_coords: Calculates the distance between two latitude-longitude pairs. Accepts two pairs of latitude and longitude and a unit of measurement (kilometers/miles) and returns the distance in the specified unit.

Usage

System Requirements

All dependencies must be installed:

  • fastmcp: used to build Model Context Protocol servers.
  • geoPy: a Python library used to access geocoding/reverse geocoding locations. All dependencies are specified in requirements.txt for easy installation.

Installation Options

Option 1: Install for Claude Desktop Install using FastMCP.

Option 2: Install elsewhere When using the server elsewhere, add the following configuration to the settings file.

Environment Variables

The server can be configured through environment variables, for example, to switch the geocoding service provider (Nominatim, ArcGIS, Bing, etc.). These variables can be set in the shell or in the MCP settings file. For more variables, edit geo.py and add them to the geocoder being used.

Applicable Scenarios

Suitable for LLM applications that require geocoding capabilities, such as: finding coordinates based on an address, finding an address based on coordinates, batch processing address lists, calculating distances between addresses, etc.

Limitations

  • The availability and accuracy of geocoding services depend on the selected provider (Nominatim, ArcGIS, Bing, etc.).
  • Built-in rate limiting (for example, a 1-second delay) avoids exceeding usage limits and may affect batch processing speed.
  • Error handling catches geopy exceptions (timeouts, service errors) and returns a safe None result instead of crashing.
  • Some features (such as bounding boxes and detailed addresses) depend on whether the geocoder supports them.
  • Specific installation commands, configuration details, and environment variable names are not fully provided in the supplied materials and require reference to the repository documentation.
Up/Down to navigate · Enter to open · ESC to closeBrowse all tools