MCP-Geo
使用GeoPY的地理编码MCP Server!
简介
MCP-Geo 是一个基于 GeoPY 的地理编码服务器,为大型语言模型提供地理位置查询工具。
系统要求
- Python 3.6+
快速安装
- 克隆仓库:
git clone https://github.com/webcoderz/MCP-Geo.git
cd MCP-Geo
- 安装依赖:
uv pip install -r requirements.txt
安装选项
选项1:Claude Desktop 安装
fastmcp install geo.py --name "MCP Geo"
选项2:其他环境安装
将以下配置添加到设置文件中:
{
"mcp-geo": {
"command": "uv",
"args": ["run", "--with", "fastmcp", "fastmcp", "run", "MCP-Geo/geo.py"],
"env": {"NOMINATIM_URL": "nominatim.openstreetmap.org"}
}
}
主要功能
MCP-Geo 提供以下地理编码工具:
- geocode_location: 将地址转换为经纬度坐标
- reverse_geocode: 将经纬度坐标转换为地址
- geocode_with_details: 提供详细地址信息和边界框
- geocode_multiple_locations: 批量地址地理编码
- reverse_geocode_multiple_locations: 批量坐标反向地理编码
- distance_between_addresses: 计算两个地址之间的距离
- distance_between_coords: 计算两个坐标点之间的距离
环境配置
通过环境变量自定义服务器:
变量 | 描述 | 默认值 |
---|---|---|
GEOCODER_PROVIDER | 地理编码提供商 | nominatim |
NOMINATIM_URL | Nominatim服务器域名 | nominatim.openstreetmap.org |
SCHEME | 连接协议 | http |
BING_API_KEY | Bing Maps API密钥 | None |
安全特性
- 请求限速保护
- 错误处理机制
- 无数据泄露风险
更多详情请参阅GitHub仓库。