Optimize geocoding with MCP-Geo Python server for fast accurate location services
MCP-Geo is an advanced geocoding MCP server that enables large language models (LLMs) and AI applications to perform precise location-based tasks. Built on the FastMCP framework, it leverages the robust capabilities of GeoPy for both forward and reverse geocoding. This server is designed to integrate seamlessly with various MCP clients such as Claude Desktop, Continue, Cursor, and more, offering a standardized protocol for geolocation services.
MCP-Geo provides several key features that enhance the capabilities of AI applications through Model Context Protocol (MCP):
The server includes a suite of geocoding tools designed to facilitate precise location queries:
geocode_location
, but includes additional data like bounding boxes for more intricate use cases.None
for unsuccessful lookups. Also rate-limited.The server also supports distance calculation functionalities:
These features make MCP-Geo a versatile tool for AI applications that require geolocation-based services, ensuring seamless integration with various clients and comprehensive data processing capabilities.
MCP-Geo is built using the FastMCP framework, which facilitates easy integration into the Model Context Protocol architecture. The core of the server resides in geo.py
, where each geocoding tool is implemented. This script leverages GeoPy for accurate and efficient geolocation services.
requirements.txt
.To ensure stability and compliance, the server includes several safety measures:
None
results are returned instead of crashing the application.To set up MCP-Geo for use in your environment:
For deployment on Claude Desktop, you can use FastMCP to install the server directly:
fastmcp install geo.py --name "MCP Geo"
This command configures the server within Claude Desktop using its built-in management tools.
To integrate MCP-Geo into your broader AI ecosystem:
Clone the repository and navigate to the directory:
git clone https://github.com/webcoderz/MCP-Geo.git
cd MCP-Geo
Install dependencies from requirements.txt
:
pip install -r requirements.txt
Configure the server in the settings file, including environment variables for provider selection and API keys.
In AI weather forecasting applications, geocoding is essential for identifying regions based on user queries. MCP-Geo can be used to convert addresses into coordinates, enabling accurate weather data requests from APIs like OpenWeatherMap.
Social media applications that rely on location information can use MCP-Geo to facilitate feature-rich user experiences. Integrating geocoding and reverse geocoding tools allows for precise place names and descriptions, enhancing user engagement and navigation through detailed maps.
MCP clients like Claude Desktop support a wide range of servers via the Model Context Protocol. Here’s the compatibility matrix:
MCP Client | Resources | Tools | Prompts | Status |
---|---|---|---|---|
Claude Desktop | ✅ | ✅ | ✅ | Full Support |
Continue | ✅ | ✅ | ✅ | Full Support |
Cursor | ❌ | ✅ | ❌ | Tools Only |
To integrate MCP-Geo with Claude Desktop, modify the settings file to include the geo.py server:
{
"mcp-geo": {
"command": "uv",
"args": [
"run",
"--with",
"fastmcp",
"fastmcp",
"run",
"./MCP-Geo/geo.py"
],
"env": {
"NOMINATIM_URL": "nominatim.openstreetmap.org"
}
}
}
The performance of MCP-Geo has been tested across various environments, ensuring robust compatibility and efficiency:
Operation | Processing Time (ms) | Success Rate (%) |
---|---|---|
geocode_location | 50-120 | 98 |
reverse_geocode | 60-100 | 97 |
distance_between_coords | 30-40 | 99 |
MCP-Geo is compatible with Python 3.6+ and various operating systems like Windows, macOS, and Linux.
For advanced configurations, adjust the following environment variables in geo.py
:
{
"GEOCODER_PROVIDER": ["nominatim", "arcgis", "bing"], // Default: nominatim
"NOMINATIM_URL": "https://nominatim.openstreetmap.org", // Default: nominatim.openstreetmap.org
"SCHEME": "http", // Default: http
"ARC_USERNAME": "", // Optional for ArcGIS
"ARC_PASSWORD": "", // Optional for ArcGIS
"BING_API_KEY": "" // Required for Bing
}
Ensure that sensitive information such as API keys and environment variables are stored securely.
How do I install MCP-Geo on Claude Desktop?
fastmcp install geo.py --name "MCP Geo"
.What are the rate limits for geocoding requests?
Can I reverse geocode multiple locations at once?
reverse_geocode_multiple_locations
which processes a list of [lat, lon] pairs efficiently.What environment variables are required for the Bing provider?
BING_API_KEY
in your environment to enable geocoding with Bing Maps services.Does MCP-Geo support custom geocoding providers?
Contributions are welcomed for expanding features and improving documentation. To contribute:
git checkout -b feature-branch
.For more information on MCP and related tools, refer to the official documentation:
By leveraging MCP-Geo, developers can extend the capabilities of their AI applications with geolocation services, ensuring robust and flexible integration across multiple platforms.
graph TD
A[AI Application] -->|MCP Client| B[MCP Protocol]
B --> C[MCP Server]
C --> D[Data Source/Tool]
style A fill:#e1f5fe
style C fill:#f3e5f5
style D fill:#e8f5e8
MCP Client | Resources | Tools | Prompts | Status |
---|---|---|---|---|
Claude Desktop | ✅ | ✅ | ✅ | Full Support |
Continue | ✅ | ✅ | ✅ | Full Support |
Cursor | ❌ | ✅ | ❌ | Tools Only |
{
"mcpServers": {
"[server-name]": {
"command": "npx fastmcp",
"args": [
"--run",
"./MCP-Geo/geo.py"
],
"env": {
"NOMINATIM_URL": "https://nominatim.openstreetmap.org",
"GEOCODER_PROVIDER": "nominatim"
}
}
}
}
This comprehensive documentation positions MCP-Geo as a valuable addition to the Model Context Protocol ecosystem, providing a robust set of geocoding tools for AI applications.
RuinedFooocus is a local AI image generator and chatbot image server for seamless creative control
Learn to set up MCP Airflow Database server for efficient database interactions and querying airflow data
Simplify MySQL queries with Java-based MysqlMcpServer for easy standard input-output communication
Build stunning one-page websites track engagement create QR codes monetize content easily with Acalytica
Access NASA APIs for space data, images, asteroids, weather, and exoplanets via MCP integration
Explore CoRT MCP server for advanced self-arguing AI with multi-LLM inference and enhanced evaluation methods