OpenStreetMap MCP Server
OpenStreetMap(OSM)MCP服务器
OpenStreetMap MCP 服务器实现,通过基于位置的服务和地理空间数据增强 LLM 功能。
演示
会合点优化

邻域分析

停车位搜索

Related MCP server: Google Maps MCP Server
特征
该服务器为 LLM 提供与 OpenStreetMap 数据交互的工具,使基于位置的应用程序能够:
将地址和地名地理编码为坐标
将地理编码坐标反向转换为地址
查找附近的兴趣点
获取位置之间的路线指引
在边界框内按类别搜索地点
为多人推荐最佳会面地点
探索区域并获取全面的位置信息
查找某个地点附近的学校和教育机构
分析家和工作地点之间的通勤选择
定位带有连接器和电源滤波的电动汽车充电站
执行房地产社区宜居性分析
查找停车设施的可用性和费用信息
成分
资源
服务器实现基于位置的资源:
location://place/{query}:按名称或地址获取地点信息location://map/{style}/{z}/{x}/{y}:获取指定坐标处的样式地图图块
工具
该服务器实现了几个地理空间工具:
geocode_address:将文本转换为地理坐标reverse_geocode:将坐标转换为人类可读的地址find_nearby_places:发现某个地点附近的兴趣点get_route_directions:获取位置之间的逐向导航search_category:查找某个区域内特定类别的地点suggest_meeting_point:为多人寻找最佳会面地点explore_area:获取有关社区的综合数据find_schools_nearby:查找特定位置附近的教育机构analyze_commute:比较家和工作地点之间的交通选择find_ev_charging_stations:通过筛选定位电动汽车充电基础设施analyze_neighborhood:评估房地产社区的宜居性find_parking_facilities:查找目的地附近的停车选项
用例
房地产决策
法学硕士可以帮助用户评估潜在的购房社区:
本地测试
运行服务器
要在本地运行服务器:
以开发模式安装包:
pip install -e .启动服务器:
osm-mcp-server服务器将启动并监听标准输入/输出上的 MCP 请求。
使用示例客户端进行测试
该存储库在examples/目录中包含两个示例客户端:
基本客户端示例
client.py演示了 OSM MCP 服务器的基本用法:
python examples/client.py这将:
连接到本地运行的服务器
获取有关旧金山的信息
搜索该地区的餐馆
通过进度跟踪检索综合地图数据
LLM 集成示例
llm_client.py提供了一个专为 LLM 集成设计的帮助类:
python examples/llm_client.py此示例展示了法学硕士 (LLM) 如何使用位置助手来执行以下操作:
从文本查询中获取位置信息
查找附近的兴趣点
获取地点之间的路线
寻找最佳会面地点
探索社区
编写自己的客户端
要创建您自己的客户端:
导入MCP客户端:
from mcp.client import Client使用您的服务器 URL 初始化客户端:
client = Client("http://localhost:8000")调用工具或访问资源:
# Example: Geocode an address
results = await client.invoke_tool("geocode_address", {"address": "New York City"})配置
安装
克劳德桌面
在 MacOS 上: ~/Library/Application\ Support/Claude/claude_desktop_config.json在 Windows 上: %APPDATA%/Claude/claude_desktop_config.json
"mcpServers": {
"osm-mcp-server": {
"command": "uv",
"args": [
"--directory",
"/path/to/osm-mcp-server",
"run",
"osm-mcp-server"
]
}
}"mcpServers": {
"osm-mcp-server": {
"command": "uvx",
"args": [
"osm-mcp-server"
]
}
}发展
构建和发布
准备分发包:
同步依赖项并更新锁文件:
uv sync构建软件包分发版:
uv build这将在dist/目录中创建源和轮子分布。
发布到 PyPI:
uv publish注意:您需要通过环境变量或命令标志设置 PyPI 凭据。
调试
由于 MCP 服务器通过 stdio 运行,调试起来可能比较困难。为了获得最佳调试体验,我们强烈建议使用MCP Inspector 。
您可以使用以下命令通过npm启动 MCP Inspector:
npx @modelcontextprotocol/inspector uv --directory /path/to/osm-mcp-server run osm-mcp-server启动后,检查器将显示一个 URL,您可以在浏览器中访问该 URL 以开始调试。
API 使用示例
以下是如何使用 Python 代码中的关键 API 端点的简单示例:
import asyncio
from mcp.client import Client
async def main():
client = Client("http://localhost:8000")
# Geocode an address
results = await client.invoke_tool("geocode_address", {"address": "Empire State Building"})
print(f"Found location: {results[0]['display_name']}")
# Get coordinates
lat = float(results[0]['lat'])
lon = float(results[0]['lon'])
# Find nearby coffee shops
nearby = await client.invoke_tool(
"find_nearby_places",
{
"latitude": lat,
"longitude": lon,
"radius": 500,
"categories": ["amenity"],
"limit": 5
}
)
# Print results
print(f"Found {nearby['total_count']} nearby places")
for category, subcategories in nearby["categories"].items():
for subcategory, places in subcategories.items():
print(f" - {subcategory}: {len(places)} places")
if __name__ == "__main__":
asyncio.run(main())Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceProvides AI applications with geospatial intelligence through Mapbox APIs, enabling geocoding, POI search, routing, travel time analysis, isochrone generation, and static map creation for location-aware functionality.1,375BSD 3-Clause
- FlicenseNot gradedqualityCmaintenanceEnables location-aware AI agents to search for nearby places, get detailed place information including hours and ratings, and calculate routes with turn-by-turn directions using Google Maps APIs.22

Mapbox MCP Serverofficial
AlicenseAqualityAmaintenanceProvides geospatial intelligence to AI agents through Mapbox APIs, enabling geocoding, routing, POI search, map images, and offline spatial calculations.281,375353MIT
Magic Lane MCP Serverofficial
AlicenseBqualityBmaintenanceEnables AI agents to become geospatially intelligent assistants with tools for location search, smart routing, round trip planning, reverse geocoding, isochrone analysis, route visualization, geofence management, and interactive map display.8377Apache 2.0
Related MCP Connectors
Address validation & geocoding for AI agents: 240+ countries, UK PAF, free US/CA enrichment
Geospatial intelligence with Mapbox APIs like geocoding, POI search, directions, isochrones, etc.
Real-world data for agents: air quality, geocoding, quakes, holidays, web search
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/jagan-shanmugam/open-streetmap-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server