OpenStreetMap MCP Server
MCP-сервер OpenStreetMap (OSM)
Реализация сервера OpenStreetMap MCP, которая расширяет возможности LLM с помощью сервисов на основе определения местоположения и геопространственных данных.
Демо
Оптимизация точки встречи

Анализ соседства

Поиск парковки

Related MCP server: Mapbox MCP Server
Установка
В хостах MCP, таких как Claude Desktop, Cursor, Windsurf и т. д.
osm-mcp-server: Основной сервер, доступный для публичного использования."mcpServers": { "osm-mcp-server": { "command": "uvx", "args": [ "osm-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В этом примере показано, как магистр права может использовать помощника по местоположению для:
Получайте информацию о местоположении из текстовых запросов
Найти ближайшие интересные места
Прокладывайте маршруты между локациями
Найдите оптимальные места встречи
Исследуйте окрестности
Написание собственного клиента
Чтобы создать собственного клиента:
Импортируйте клиент 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"})Конфигурация Claude Desktop для локального сервера
В 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"
]
}
}Разработка
Строительство и издательское дело
Чтобы подготовить пакет к распространению:
Синхронизируем зависимости и обновляем файл блокировки:
uv syncСборка дистрибутивов пакетов:
uv buildЭто создаст исходный код и дистрибутивы wheel в каталоге dist/ .
Опубликовать в PyPI:
uv publishПримечание: вам необходимо будет задать учетные данные PyPI с помощью переменных среды или флагов команд.
Отладка
Поскольку серверы MCP работают через stdio, отладка может быть сложной. Для лучшего опыта отладки мы настоятельно рекомендуем использовать MCP Inspector .
Вы можете запустить MCP Inspector через npm с помощью этой команды:
npx @modelcontextprotocol/inspector uv --directory /path/to/osm-mcp-server run osm-mcp-serverПосле запуска Инспектор отобразит URL-адрес, к которому вы можете перейти в своем браузере, чтобы начать отладку.
Available Tools
12 toolsanalyze_commuteA
Perform a detailed commute analysis between home and work locations.
This advanced tool analyzes commute options between two locations (typically home and work), comparing multiple transportation modes and providing detailed metrics for each option. Includes estimated travel times, distances, turn-by-turn directions, and other commute-relevant data. Essential for real estate decisions, lifestyle planning, and workplace relocation analysis.
Args: home_latitude: Home location latitude (decimal degrees) home_longitude: Home location longitude (decimal degrees) work_latitude: Workplace location latitude (decimal degrees) work_longitude: Workplace location longitude (decimal degrees) modes: List of transportation modes to analyze (options: "car", "foot", "bike") depart_at: Optional departure time (format: "HH:MM") for time-sensitive routing
Returns: Comprehensive commute analysis with: - Summary comparing all transportation modes - Detailed route information for each mode - Total distance and duration for each option - Turn-by-turn directions
Inputs: home_latitude (required), home_longitude (required), work_latitude (required), work_longitude (required), +2 more.
analyze_neighborhoodA
Generate a comprehensive neighborhood analysis focused on livability factors.
This advanced analysis tool evaluates a neighborhood based on multiple livability factors, including amenities, transportation options, green spaces, and services. Results include counts and proximity scores for various categories, helping to assess the overall quality and convenience of a residential area. Invaluable for real estate decisions, relocation planning, and neighborhood comparisons.
Args: latitude: Center point latitude (decimal degrees) longitude: Center point longitude (decimal degrees) radius: Analysis radius in meters (defaults to 1000m/1km)
Returns: Comprehensive neighborhood profile including: - Overall neighborhood score - Walkability assessment - Public transportation access - Nearby amenities (shops, restaurants, services) - Green spaces and recreation - Education and healthcare facilities - Detailed counts and distance metrics for each category
Inputs: latitude (required), longitude (required), radius.
explore_areaA
Generate a comprehensive profile of an area including all amenities and features.
This powerful analysis tool creates a detailed overview of a neighborhood or area by identifying and categorizing all geographic features, amenities, and points of interest. Results are organized by category for easy analysis. Excellent for neighborhood research, area comparisons, and location-based decision making.
Args: latitude: Center point latitude (decimal degrees) longitude: Center point longitude (decimal degrees) radius: Search radius in meters (defaults to 500m)
Returns: In-depth area profile including: - Address and location context - Total feature count - Features organized by category and subcategory - Each feature includes name, coordinates, and detailed metadata
Inputs: latitude (required), longitude (required), radius.
find_ev_charging_stationsA
Locate electric vehicle charging stations near a specific location.
This specialized search tool identifies EV charging infrastructure within a specified distance from a location. Results can be filtered by connector type (Tesla, CCS, CHAdeMO, etc.) and minimum power delivery. Essential for EV owners planning trips or evaluating potential charging stops.
Args: latitude: Center point latitude (decimal degrees) longitude: Center point longitude (decimal degrees) radius: Search radius in meters (defaults to 5000m/5km) connector_types: Optional list of specific connector types to filter by (e.g., ["type2", "ccs", "tesla"]) min_power: Minimum charging power in kW
Returns: List of charging stations with: - Location name and operator - Available connector types - Charging speeds - Number of charging points - Access restrictions - Other relevant metadata
Inputs: latitude (required), longitude (required), radius, connector_types, +1 more.
find_nearby_placesA
Discover points of interest and amenities near a specific location.
This tool performs a comprehensive search around a geographic point to identify nearby establishments, amenities, and points of interest. Results are organized by category and subcategory, making it easy to find specific types of places. Essential for location-based recommendations, neighborhood analysis, and proximity-based decision making.
Args: latitude: Center point latitude (decimal degrees) longitude: Center point longitude (decimal degrees) radius: Search radius in meters (defaults to 1000m/1km) categories: List of OSM categories to search for (e.g., ["amenity", "shop", "tourism"]). If omitted, searches common categories. limit: Maximum number of total results to return
Returns: Structured dictionary containing: - Original query parameters - Total count of places found - Results grouped by category and subcategory - Each place includes name, coordinates, and associated tags
Inputs: latitude (required), longitude (required), radius, categories, +1 more.
find_parking_facilitiesA
Locate parking facilities near a specific location.
This tool finds parking options (lots, garages, street parking) near a specified location. Results can be filtered by parking type and include capacity information where available. Useful for trip planning, city navigation, and evaluating parking availability in urban areas.
Args: latitude: Center point latitude (decimal degrees) longitude: Center point longitude (decimal degrees) radius: Search radius in meters (defaults to 1000m/1km) parking_type: Optional filter for specific types of parking facilities ("surface", "underground", "multi-storey", etc.)
Returns: List of parking facilities with: - Name and type - Capacity information if available - Fee structure if available - Access restrictions - Distance from search point
Inputs: latitude (required), longitude (required), radius, parking_type.
find_schools_nearbyA
Locate educational institutions near a specific location, filtered by education level.
This specialized search tool identifies schools, colleges, and other educational institutions within a specified distance from a location. Results can be filtered by education level (elementary, middle, high school, university, etc.). Essential for families evaluating neighborhoods or real estate purchases with education considerations.
Args: latitude: Center point latitude (decimal degrees) longitude: Center point longitude (decimal degrees) radius: Search radius in meters (defaults to 2000m/2km) education_levels: Optional list of specific education levels to filter by (e.g., ["elementary", "secondary", "university"])
Returns: List of educational institutions with: - Name and type - Distance from search point - Education levels offered - Contact information if available - Other relevant metadata
Inputs: latitude (required), longitude (required), radius, education_levels.
geocode_addressA
Convert an address or place name to geographic coordinates with detailed location information.
This tool takes a text description of a location (such as an address, landmark name, or place of interest) and returns its precise geographic coordinates along with rich metadata. The results can be used for mapping, navigation, location-based analysis, and as input to other geospatial tools.
Args: address: The address, place name, landmark, or description to geocode (e.g., "Empire State Building", "123 Main St, Springfield", "Golden Gate Park, San Francisco")
Returns: List of matching locations with: - Geographic coordinates (latitude/longitude) - Formatted address - Administrative boundaries (city, state, country) - OSM type and ID - Bounding box (if applicable) - Importance ranking
Inputs: address (required).
get_route_directionsA
Calculate detailed route directions between two geographic points.
This tool provides comprehensive routing information between two locations using OpenStreetMap/OSRM. The output can be minimized using the steps, overview, and annotations parameters to reduce the response size.
Args: from_latitude: Starting point latitude (decimal degrees) from_longitude: Starting point longitude (decimal degrees) to_latitude: Destination latitude (decimal degrees) to_longitude: Destination longitude (decimal degrees) ctx: Context (provided internally by MCP) mode: Transportation mode ("car", "bike", "foot") steps: Turn-by-turn instructions (True/False, Default: False) overview: Geometry output ("full", "simplified", "false"; Default: "simplified") annotations: Additional segment info (True/False, Default: False)
Returns: Dictionary with routing information (summary, directions, geometry, waypoints)
Example: { "from_latitude": 51.3334193, "from_longitude": 9.4540423, "to_latitude": 51.3295516, "to_longitude": 9.4576721, "mode": "car", "steps": false, "overview": "simplified", "annotations": false }
Inputs: from_latitude (required), from_longitude (required), to_latitude (required), to_longitude (required), +4 more.
reverse_geocodeA
Convert geographic coordinates to a detailed address and location description.
This tool takes a specific point on Earth (latitude and longitude) and returns comprehensive information about that location, including its address, nearby landmarks, administrative boundaries, and other contextual information. Useful for translating GPS coordinates into human-readable locations.
Args: latitude: The latitude coordinate (decimal degrees, WGS84) longitude: The longitude coordinate (decimal degrees, WGS84)
Returns: Detailed address and location information including: - Formatted address - Building, street, city, state, country - Administrative hierarchy - OSM metadata - Postal code and other relevant identifiers
Inputs: latitude (required), longitude (required).
search_categoryA
Search for specific types of places within a defined geographic area.
This tool allows targeted searches for places matching specific categories within a rectangular geographic region. It's particularly useful for filtering places by type (restaurants, schools, parks, etc.) within a neighborhood or city district. Results include complete location details and metadata about each matching place.
Args: category: Main OSM category to search for (e.g., "amenity", "shop", "tourism", "building") min_latitude: Southern boundary of search area (decimal degrees) min_longitude: Western boundary of search area (decimal degrees) max_latitude: Northern boundary of search area (decimal degrees) max_longitude: Eastern boundary of search area (decimal degrees) subcategories: Optional list of specific subcategories to filter by (e.g., ["restaurant", "cafe"])
Returns: Structured results including: - Query parameters - Count of matching places - List of matching places with coordinates, names, and metadata
Inputs: category (required), min_latitude (required), min_longitude (required), max_latitude (required), +2 more.
suggest_meeting_pointA
Find the optimal meeting place for multiple people coming from different locations.
This tool calculates a central meeting point based on the locations of multiple individuals, then recommends suitable venues near that central point. Ideal for planning social gatherings, business meetings, or any situation where multiple people need to converge from different starting points.
Args: locations: List of dictionaries, each containing the latitude and longitude of a person's location Example: [{"latitude": 37.7749, "longitude": -122.4194}, {"latitude": 37.3352, "longitude": -121.8811}] venue_type: Type of venue to suggest as a meeting point. Options include: "cafe", "restaurant", "bar", "library", "park", etc.
Returns: Meeting point recommendations including: - Calculated center point coordinates - List of suggested venues with names and details - Total number of matching venues in the area
Inputs: locations (required), venue_type.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 12 tools
Most tools have distinct purposes, such as geocode_address for address-to-coordinates and reverse_geocode for coordinates-to-address. However, some overlap exists: explore_area and analyze_neighborhood both provide area profiles, and find_nearby_places and search_category both search for places by category, which could cause confusion without careful reading of descriptions.
All tool names follow a consistent verb_noun pattern using snake_case, such as analyze_commute, find_ev_charging_stations, and suggest_meeting_point. This predictability makes it easy for agents to understand and use the toolset without naming confusion.
With 12 tools, the server is well-scoped for an OpenStreetMap-based geospatial analysis platform. Each tool serves a specific purpose, from routing and geocoding to specialized searches (e.g., schools, parking, EV charging), covering a comprehensive range of location-based queries without being overwhelming.
The toolset provides strong coverage for geospatial analysis, including geocoding, routing, area exploration, and targeted searches. Minor gaps exist, such as no direct tool for editing or contributing to OpenStreetMap data, but the available tools support most common location-based workflows effectively.
Maintenance
Related MCP Connectors
Place search, routes and spatial reasoning for AI agents, with real-world addresses.
Mobility, geocoding and nearby urban services for AI agents.
Location infrastructure for AI to search and reason over places.
Routing, geocoding, places, matrix and map tools for location-aware AI workflows.
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.BSD 3-Clause

Mapbox MCP Serverofficial
AlicenseAqualityBmaintenanceProvides geospatial intelligence to AI agents through Mapbox APIs, enabling geocoding, routing, POI search, map images, and offline spatial calculations.334,303 npm375MIT
Magic Lane MCP Serverofficial
AlicenseBqualityCmaintenanceEnables 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.820 npm8Apache 2.0- AlicenseAqualityDmaintenanceProvides location-based services and geospatial data from OpenStreetMap, enabling geocoding, route directions, nearby place search, and neighborhood analysis through natural language.12MIT