MCP地图代理–OSM+OSRM
此repo实现 2个自定义MCP地图服务器 和a OpenAI代理 使用它们:
OSM Geocoding Server–获得OpenStreetMap提名:
- 正向地理编码(search_place) - 反向地理编码(reverse_geocode) - 简单POI搜索(search_pois)
OSRM Routing Server–为以下内容包装了OSRM演示API:
- 行车路线(route_between) - 路线文本摘要(route_summary) - 距离矩阵(distance_matrix)
一 Agent 与建 OpenAI代理SDK 使用以下方式连接到两个服务器 MCPServerStdio,因此它可以根据用户查询动态选择合适的地图工具。
______________________________________________________________________
设置
git clone # or use the folder you already created
cd mcp-map-agents
python -m venv .venv
source .venv/bin/activate # or .venv\Scripts\activate on Windows
pip install -r requirements.txt
cp .env.example .env
# Edit .env and set OPENAI_API_KEY and NOMINATIM_USER_AGENT