MCP Server for geospatial operations - geocoding, routing, spatial analysis
Project description
LocuSync Server
A Model Context Protocol (MCP) server providing geospatial tools for AI agents. Enables Claude, GPT, and other LLMs to perform geocoding, routing, spatial analysis, and file operations.
Features
- Geocoding: Convert addresses to coordinates and vice versa (via Nominatim/OSM or Pelias)
- Batch Geocoding: Geocode multiple addresses in a single request (up to 10)
- Elevation Data: Get altitude for points and elevation profiles along paths
- Routing: Calculate routes between points with distance, duration, and geometry (via OSRM)
- Spatial Analysis: Buffer, intersection, union, distance calculations
- File I/O: Read/write Shapefiles, GeoJSON, GeoPackage
- CRS Transformation: Convert between coordinate reference systems
Installation
# From PyPI (when published)
pip install locusync-server
# From source
git clone https://github.com/matbel91765/locusync-server.git
cd locusync-server
pip install -e .
Quick Start
With Claude Desktop
Add to your claude_desktop_config.json:
{
"mcpServers": {
"locusync": {
"command": "uvx",
"args": ["locusync-server"]
}
}
}
Direct Usage
# Run the server
locusync-server
Available Tools
Geocoding
geocode
Convert an address to coordinates.
Input: "1600 Pennsylvania Avenue, Washington DC"
Output: {lat: 38.8977, lon: -77.0365, display_name: "White House..."}
reverse_geocode
Convert coordinates to an address.
Input: lat=48.8566, lon=2.3522
Output: {display_name: "Paris, Île-de-France, France", ...}
batch_geocode
Geocode multiple addresses at once (max 10).
Input: addresses=["Paris, France", "London, UK", "Berlin, Germany"]
Output: {results: [...], summary: {total: 3, successful: 3, failed: 0}}
Elevation
get_elevation
Get altitude for a point.
Input: lat=48.8566, lon=2.3522
Output: {elevation_m: 35, location: {lat: 48.8566, lon: 2.3522}}
get_elevation_profile
Get elevations along a path.
Input: coordinates=[[2.3522, 48.8566], [2.2945, 48.8584]]
Output: {profile: [...], stats: {min: 28, max: 42, gain: 14}}
Geometry
distance
Calculate distance between two points.
Input: lat1=48.8566, lon1=2.3522, lat2=51.5074, lon2=-0.1278
Output: {distance: {meters: 343556, kilometers: 343.56, miles: 213.47}}
buffer
Create a buffer zone around a geometry.
Input: geometry={type: "Point", coordinates: [2.3522, 48.8566]}, distance_meters=1000
Output: {geometry: {type: "Polygon", ...}, area_km2: 3.14}
spatial_query
Perform spatial operations (intersection, union, contains, within, etc.).
Input: geometry1={...}, geometry2={...}, operation="intersection"
Output: {geometry: {...}}
transform_crs
Transform coordinates between CRS.
Input: geometry={...}, source_crs="EPSG:4326", target_crs="EPSG:3857"
Output: {geometry: {...}}
Routing
route
Calculate route between two points.
Input: start_lat=48.8566, start_lon=2.3522, end_lat=48.8606, end_lon=2.3376
Output: {distance: {...}, duration: {...}, geometry: {...}, steps: [...]}
isochrone
Calculate area reachable within a time limit.
Input: lat=48.8566, lon=2.3522, time_minutes=15, profile="driving"
Output: {geometry: {type: "Polygon", ...}}
Files
read_file
Read geospatial files (Shapefile, GeoJSON, GeoPackage).
Input: file_path="data/cities.shp"
Output: {type: "FeatureCollection", features: [...]}
write_file
Write features to geospatial files.
Input: features={...}, file_path="output.geojson", driver="GeoJSON"
Output: {file_path: "...", feature_count: 10}
Configuration
Environment variables:
| Variable | Default | Description |
|---|---|---|
NOMINATIM_URL |
https://nominatim.openstreetmap.org |
Nominatim API URL |
NOMINATIM_USER_AGENT |
locusync-server/1.0.0 |
User agent for Nominatim |
OSRM_URL |
https://router.project-osrm.org |
OSRM API URL |
OSRM_PROFILE |
driving |
Default routing profile |
PELIAS_URL |
(empty) | Pelias geocoding API URL |
PELIAS_API_KEY |
(empty) | Pelias API key (optional) |
OPEN_ELEVATION_URL |
https://api.open-elevation.com |
Open-Elevation API URL |
GIS_DEFAULT_CRS |
EPSG:4326 |
Default CRS |
GIS_TEMP_DIR |
/tmp/locusync |
Temporary directory |
Response Format
All tools return a consistent JSON structure:
{
"success": true,
"data": { ... },
"metadata": {
"source": "nominatim",
"confidence": 0.95
},
"error": null
}
Rate Limits
- Nominatim: 1 request/second (enforced automatically)
- OSRM Demo: Best effort, consider self-hosting for production
Development
# Install dev dependencies
pip install -e ".[dev]"
# Run tests
pytest
# Run with coverage
pytest --cov=src/locusync --cov-report=html
# Type checking
mypy src/locusync
# Linting
ruff check src/locusync
Architecture
src/locusync/
├── server.py # MCP server entry point
├── config.py # Configuration management
├── utils.py # Common utilities
└── tools/
├── geocoding.py # geocode, reverse_geocode, batch_geocode
├── elevation.py # get_elevation, get_elevation_profile
├── routing.py # route, isochrone
├── geometry.py # buffer, distance, spatial_query, transform_crs
└── files.py # read_file, write_file
License
MIT License - see LICENSE for details.
Contributing
Contributions welcome! Please read the contributing guidelines before submitting PRs.
Roadmap
- Pelias geocoding support (higher accuracy)
- Elevation/terrain data
- Batch geocoding
- Valhalla routing integration (native isochrones)
- PostGIS spatial queries
- Real-time traffic data
- ESRI FileGDB full support
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file locusync_server-1.2.0.tar.gz.
File metadata
- Download URL: locusync_server-1.2.0.tar.gz
- Upload date:
- Size: 51.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6c9bba7212df561ebc0b0d8811d31c4135009a2a1548f0252316d4ef7f9b298c
|
|
| MD5 |
575a3d6187ff27ba56f32964aac05b97
|
|
| BLAKE2b-256 |
87f7a4c4715af5dc86dfb8da2f0717218dad4b884f75db21362d259549a16376
|
Provenance
The following attestation bundles were made for locusync_server-1.2.0.tar.gz:
Publisher:
publish.yml on matbel91765/GIS-MCP-Server
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
locusync_server-1.2.0.tar.gz -
Subject digest:
6c9bba7212df561ebc0b0d8811d31c4135009a2a1548f0252316d4ef7f9b298c - Sigstore transparency entry: 743613804
- Sigstore integration time:
-
Permalink:
matbel91765/GIS-MCP-Server@5e759cf191fc3ef57330d5f4fce737dde068ca67 -
Branch / Tag:
refs/heads/master - Owner: https://github.com/matbel91765
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@5e759cf191fc3ef57330d5f4fce737dde068ca67 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file locusync_server-1.2.0-py3-none-any.whl.
File metadata
- Download URL: locusync_server-1.2.0-py3-none-any.whl
- Upload date:
- Size: 43.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eca6d757f8f4a4b9492761f3a03c01a35255432499e929131536962421205741
|
|
| MD5 |
ecb6991026a442251e98ea0c7c157100
|
|
| BLAKE2b-256 |
276debd5d03d7eb7f17a5fa7c39a65fb529c933ec4d2d82b6d522e671d58b4ec
|
Provenance
The following attestation bundles were made for locusync_server-1.2.0-py3-none-any.whl:
Publisher:
publish.yml on matbel91765/GIS-MCP-Server
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
locusync_server-1.2.0-py3-none-any.whl -
Subject digest:
eca6d757f8f4a4b9492761f3a03c01a35255432499e929131536962421205741 - Sigstore transparency entry: 743613810
- Sigstore integration time:
-
Permalink:
matbel91765/GIS-MCP-Server@5e759cf191fc3ef57330d5f4fce737dde068ca67 -
Branch / Tag:
refs/heads/master - Owner: https://github.com/matbel91765
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@5e759cf191fc3ef57330d5f4fce737dde068ca67 -
Trigger Event:
workflow_dispatch
-
Statement type: