LocuSync Server

LocuSync Server

A geospatial MCP server that provides tools for geocoding, routing, elevation profiles, and spatial analysis. It enables AI agents to process GIS file formats like GeoJSON and Shapefiles while performing complex coordinate transformations and distance calculations.

Category
访问服务器

README

LocuSync Server

PyPI version Python 3.11+ License: MIT CI

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

  • [x] Pelias geocoding support (higher accuracy)
  • [x] Elevation/terrain data
  • [x] Batch geocoding
  • [ ] Valhalla routing integration (native isochrones)
  • [ ] PostGIS spatial queries
  • [ ] Real-time traffic data
  • [ ] ESRI FileGDB full support

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选