OSM PostgreSQL Server
MCP-OSM:MCP 的 OpenStreetMap 集成
该软件包为 MCP 提供 OpenStreetMap 集成,允许用户通过 MCP 界面查询和可视化地图数据。

特征
使用 Leaflet 和 OpenStreetMap 的基于 Web 的地图查看器
通过服务器发送事件 (SSE) 进行服务器到客户端通信
用于地图控制的 MCP 工具(添加标记、多边形、设置视图、获取视图)
OpenStreetMap 数据的 PostgreSQL/PostGIS 查询接口
Related MCP server: Google Maps Platform MCP Server
安装
这是我的claude_desktop_config.json :
{
"mcpServers": {
"OSM PostgreSQL Server": {
"command": "/Users/wiseman/.local/bin/uv",
"args": [
"run",
"--env-file",
".env",
"--with",
"mcp[cli]",
"--with",
"psycopg2",
"--with-editable",
"/Users/wiseman/src/mcp-osm",
"--directory",
"/Users/wiseman/src/mcp-osm",
"mcp",
"run",
"mcp.py"
]
}
}
}当 MCP 服务器启动时,它还会在http://localhost:8889/启动一个具有地图界面的 Web 服务器。
环境变量
以下环境变量可用于配置 MCP:
FLASK_HOST- Flask 服务器的主机(默认值:127.0.0.1)FLASK_PORT- Flask 服务器的端口(默认值:8889)PGHOST- PostgreSQL 主机(默认:localhost)PGPORT- PostgreSQL 端口(默认值:5432)PGDB-PostgreSQL 数据库名称(默认:osm)PGUSER- PostgreSQL 用户名(默认值:postgres)PGPASSWORD- PostgreSQL 密码(默认:postgres)
MCP 工具
以下 MCP 工具可用:
get_map_view- 获取当前地图视图set_map_view- 将地图视图设置为特定坐标或边界set_map_title- 设置地图右下角显示的标题add_map_marker- 在特定坐标处添加标记add_map_line- 添加由一组坐标定义的线add_map_polygon- 添加由一组坐标定义的多边形query_osm_postgres- 对 OpenStreetMap 数据库执行 SQL 查询
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Unofficial Nominatim MCP — wraps OpenStreetMap Nominatim geocoding API (free, no auth)
Unofficial OpenTripMap MCP — wraps the OpenTripMap Places API (dev.opentripmap.org)
OpenStreetMap Overpass MCP — programmatic queries against the OSM database
Unofficial Geoapify MCP — wraps the Geoapify Location Platform (geoapify.com)
Related MCP Servers
- AlicenseAqualityBmaintenanceProvides access to Google Maps API functionality including places search, geocoding, directions, distance matrix, elevation data, and static map generation through the MCP interface.81MIT
- AlicenseNot gradedqualityDmaintenanceProvides MCP tools for Google Maps services including directions, geocoding, distance matrix, and places search.13Apache 2.0
- AlicenseNot gradedqualityAmaintenanceGeocode, reverse geocode, and run Overpass spatial queries on OpenStreetMap data via MCP.737 npm9Apache 2.0
- AlicenseAqualityDmaintenanceMCP server providing structured access to OpenStreetMap data through Overpass and Nominatim APIs, enabling geocoding, nearby place searches, element queries, and tag counting without API keys.7MIT