osm-mcp
osm-mcp
Ein MCP-Server für OpenStreetMap: Geokodierung, Geh-/Fahr-/Radfahrstrecken und -dauern, Optimierung von Routen mit mehreren Zwischenstopps, Isochronen und POI-Suche – entwickelt für die Reiseplanung mit KI-Assistenten.
11 Werkzeuge, alle schreibgeschützt. Alle Backends sind kostenlose öffentliche OpenStreetMap-Dienste; es ist kein API-Schlüssel erforderlich. Ein OpenRouteService-Schlüssel kann optional angegeben werden, um die Routing-Engine zu wechseln.
📖 Vollständige Dokumentation: https://osm-mcp.ni-c.de
Warum ein weiterer OSM-MCP-Server?
Korrekte Geh- und Radfahrrouten. Die öffentlichen OSRM-Demo-Server ignorieren das Profilsegment im OSRM-URL-Pfad und geben immer Auto-Routen zurück, es sei denn, die FOSSGIS-Pfadpräfixe
routed-foot/routed-bike/routed-carwerden verwendet. Die meisten vorhandenen OSM-MCP-Server machen das falsch und geben stillschweigend Fahrzeiten für Fußwege-Anfragen zurück. Dieser Server verwendet die Präfixe und sein Live-Smoke-Test stellt sicher, dass Fußwege viel langsamer sind als Autostrecken.Richtlinienkonform von Grund auf. Dienstspezifische Ratenbegrenzung (Nominatim und OSRM: 1 Anfrage/Sekunde), ein identifizierender User-Agent bei jeder Anfrage (erforderlich durch die Nominatim-Nutzungsrichtlinie), Antwort-Caching, begrenzte Overpass-Gleichzeitigkeit (2 Slots) und automatisches Failover auf einen Overpass-Spiegel bei 429/5xx.
Photon-Unterstützung. Optionale tippfehlertolerante Geokodierung über komoots Photon, das für die interaktive Nutzung konzipiert ist – eine bessere Wahl für LLM-gesteuerte Abfragen als Nominatim zu überlasten.
Related MCP server: Geo MCP Worker
Voraussetzungen
Node.js ≥ 22
Internetzugang zu den öffentlichen OpenStreetMap-Diensten (siehe Tabelle unten)
Konfiguration
Jede Variable ist optional – der Server funktioniert sofort einsatzbereit.
Variable | Standard | Beschreibung |
|
| User-Agent, der an jeden Dienst gesendet wird. Nominatim erfordert einen echten, identifizierenden. |
|
| Geokodierung / Reverse-Geokodierung |
|
| Tippfehlertolerante Geokodierung |
|
| Routing, Matrizen, Tourenoptimierung. Muss die Pfadpräfixe |
|
| Kommagetrennte Overpass-Endpunkte, die bei 429/5xx der Reihe nach probiert werden |
|
| Isochronen |
| – | Optionaler OpenRouteService-Schlüssel (geheim). Wenn gesetzt, verwenden Routen, Matrizen und Isochronen ORS anstelle von OSRM/Valhalla. Kostenloses Kontingent: 2000 Richtungen/Tag, 40/Minute. |
|
| OpenRouteService-Endpunkt |
|
| Sekunden, die identische Upstream-Antworten aus dem Arbeitsspeicher-Cache ausgeliefert werden ( |
Installieren
claude mcp add osm -- npx -y osm-mcpClaude Desktop (claude_desktop_config.json):
{
"mcpServers": {
"osm": {
"command": "npx",
"args": ["-y", "osm-mcp"]
}
}
}Codex (~/.codex/config.toml):
[mcp_servers.osm]
command = "npx"
args = ["-y", "osm-mcp"]Container (Multi-Arch, mit SBOM und Build-Provenienz):
docker run -i --rm ghcr.io/ni-c/osm-mcp-i ist erforderlich – das Protokoll läuft über stdin und stdout. Es gibt keinen Port zum
Veröffentlichen. Weitere Client-Rezepte finden Sie im
Client-Leitfaden.
Werkzeuge
Werkzeug | Beschreibung |
| Ortsname/Adresse → Koordinaten (Nominatim oder Photon) |
| Koordinaten → nächste Adresse |
| Entfernung und Dauer zwischen 2+ Wegpunkten, |
| Reisezeit/Entfernung von jedem Start zu jedem Ziel in einem Aufruf |
| Beste Besuchsreihenfolge für eine Reihe von Stopps (Traveling-Salesman, OSRM-Trip) |
| Erreichbares Gebiet innerhalb eines Zeit- oder Entfernungsbudgets (Valhalla oder ORS mit Schlüssel) |
| POIs in der Umgebung eines Ortes nach Kategorie oder rohem OSM-Tag, sortiert nach Entfernung (Overpass) |
| Vollständiger OSM-Datensatz eines Elements: Öffnungszeiten, Website, Telefon, … |
| Geeigneter Treffpunkt für 2–8 Personen (ausgeglichene Reisezeiten) |
| Großkreisentfernung, offline berechnet |
| openstreetmap.org-Markierungs-/Richtungslinks, offline berechnet |
Jede Ortsangabe akzeptiert entweder einen Namen/eine Adresse (automatisch geokodiert) oder
buchstäbliche Koordinaten als "lat,lon".
Nutzungsrichtlinien & Quellenangabe
Dieser Server kommuniziert mit gemeinsamer Community-Infrastruktur. Er erzwingt die veröffentlichten Limits clientseitig, aber der Betreiber bittet die Nutzer, die Gesamtnutzung gering und nicht kommerziell zu halten:
Daten: © OpenStreetMap Mitwirkende, lizenziert unter ODbL 1.0.
Nominatim: max. 1 Anfrage/Sekunde, identifizierender User-Agent obligatorisch, Ergebnisse gecached (Richtlinie).
OSRM / Valhalla (FOSSGIS): angemessene, nicht kommerzielle Nutzung; max. 1 Anfrage/Sekunde (Info).
Overpass: ~2 gleichzeitige Slots pro IP, <10.000 Abfragen/Tag (Wiki).
Photon: faire Nutzung (photon.komoot.io).
Für intensive oder kommerzielle Nutzung hosten Sie die Dienste selbst und richten Sie die
*_BASE_URL-Variablen auf Ihre Instanzen.
Sicherheit
Alle Werkzeuge sind schreibgeschützt; der Server schreibt nie in OpenStreetMap.
Es sind keine Anmeldeinformationen erforderlich; der optionale
ORS_API_KEYwird nach dem Laden aus der Prozessumgebung entfernt und in Fehlermeldungen geschwärzt.OSM-basierte Inhalte (Namen, Adressen, Tags) werden in den Werkzeugergebnissen als nicht vertrauenswürdige Daten markiert, sodass das Modell sie als Daten und nicht als Anweisungen behandelt.
Upstream-Fehlermeldungen werden gekürzt und HTML-Fehlerseiten verworfen, bevor sie den Modellkontext erreichen.
Weiterleitungen werden nie verfolgt; alle Anfragen haben ein Timeout.
Entwicklung
npm install
npm run lint # eslint + prettier
npm test # unit tests (all upstream APIs mocked)
npm run test:coverage
npm run build
npm run smoke # opt-in LIVE test against the real public servicesVeröffentlichung
Tag-gesteuert, kein manueller Veröffentlichungsschritt:
Verschieben Sie die Einträge aus
[Unreleased]in einen neuen Abschnitt## [x.y.z] - YYYY-MM-DDinCHANGELOG.mdund erhöhen Sie die Version inpackage.json.npm run lint && npm run build && npm run test:coverage.Committen, dann einen signierten annotierten Tag:
git tag -s vx.y.z -m "vx.y.z".git push origin main vx.y.z.
release.yml führt dann die Tests aus, veröffentlicht auf npm mit Provenienz über Trusted Publishing
(kein Token-Geheimnis beteiligt), erstellt das GitHub-Release aus dem CHANGELOG-Abschnitt und veröffentlicht im
MCP-Registry als
io.github.ni-c/osm-mcp. ci.yml pusht das Multi-Arch-Image auf GHCR beim gleichen Tag.
Wenn der Registry-Schritt fehlschlägt, beheben Sie ihn auf main und lösen Sie den
Workflow Publish to MCP Registry aus – führen Sie den Tag-Job nicht erneut aus, da dieser
den alten Baum auschecken würde.
Lizenz
Available Tools
11 toolsfind_nearby_poisFind nearby places (POIs)ARead-onlyIdempotent
Finds points of interest near a location, sorted by distance. Category shortcuts: restaurant, cafe, bar, pub, fast_food, ice_cream, hotel, hostel, guest_house, apartment, camp_site, attraction, museum, gallery, viewpoint, information, artwork, castle, monument, ruins, supermarket, bakery, convenience, pharmacy, hospital, doctors, police, atm, bank, fuel, charging_station, parking, toilets, drinking_water, bus_stop, train_station, tram_stop, ferry_terminal, bicycle_rental, car_rental, playground, park, beach, swimming_pool. Any other OSM tag works as "key" or "key=value" (e.g. "diet:vegan=yes"). Use poi_details for the full record of one result.
Inputs: near (required), category (required), limit, language, +1 more. Returns: near, note, count, source, +3 more
geocodeGeocode a place or addressARead-onlyIdempotent
Converts a place name or address into coordinates using OpenStreetMap. Returns matching places with lat/lon, a display label and the OSM id. Provider "nominatim" (default) is best for addresses; "photon" is typo-tolerant and better for fuzzy place names.
Inputs: query (required), limit, language, provider, +1 more. Returns: note, source, results, provider, +1 more
isochroneReachable area (isochrone)ARead-onlyIdempotent
Shows how far you can get from a place within a time or distance budget ("what is reachable in 15 minutes on foot?"). Returns a compact summary of the reachable area: bounding box and reach per compass direction. Give exactly one of minutes or kilometers.
Inputs: center (required), profile (required), minutes, language, +1 more. Returns: reach, budget, center, engine, +4 more
map_linkGenerate map linksARead-onlyIdempotent
Generates openstreetmap.org links to open in a browser: a marker link for a single place, or a directions link when from and to are given. Provide either "place", or both "from" and "to".
Inputs: to, from, place, profile, +1 more. Returns: to, from, place, marker, +4 more
optimize_routeOptimize stop orderARead-onlyIdempotent
Finds the best order to visit a set of stops (traveling-salesman optimization) and returns the optimized itinerary with total distance and time. With roundtrip (default) the tour returns to the first stop; without it the first stop is the start and the last stop the end.
Inputs: stops (required), profile (required), language, roundtrip. Returns: legs, engine, source, profile, +4 more
poi_detailsGet POI detailsARead-onlyIdempotent
Fetches the full OpenStreetMap record of one element — all tags (opening hours, website, phone, …), coordinates and a map link. Takes an OSM id as returned by find_nearby_pois or geocode, e.g. "node/240109189".
Inputs: osm_id (required). Returns: lat, lon, map, osm, +4 more
reverse_geocodeReverse geocode coordinatesARead-onlyIdempotent
Converts coordinates into the nearest address or place name (Nominatim).
Inputs: latitude (required), longitude (required), language. Returns: note, result, source, untrusted
routeRoute between placesARead-onlyIdempotent
Calculates the real-world travel distance and time between two or more places, walking, driving or cycling, on OpenStreetMap data. Waypoints are visited in the given order. Set include_steps for a turn-by-turn summary. Use route_matrix to compare many pairs, optimize_route to reorder stops.
Inputs: profile (required), waypoints (required), language, include_steps. Returns: legs, steps, engine, source, +8 more
route_matrixTravel time/distance matrixARead-onlyIdempotent
Computes travel times and distances from every origin to every destination in one call — ideal for comparing options (e.g. 5 hotels against 3 sights). Cells are null where no route exists.
Inputs: origins (required), profile (required), destinations (required), language. Returns: engine, source, origins, profile, +4 more
straight_line_distanceStraight-line distanceARead-onlyIdempotent
Great-circle ("as the crow flies") distance between two places. Instant and independent of any road network — use route for real travel distances.
Inputs: to (required), from (required), language. Returns: to, from, source, distance, +2 more
suggest_meeting_pointSuggest a meeting pointARead-onlyIdempotent
Suggests a fair place to meet for people starting from different locations: finds venues around the geographic midpoint and picks the one with the most balanced travel times for everyone.
Inputs: locations (required), profile, language, venue_category, +1 more. Returns: note, source, profile, midpoint, +4 more
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 11 tools
Each tool has a clearly distinct purpose: geocode/reverse_geocode handle place-coordinate conversion, route/route_matrix/optimize_route are tightly differentiated by use case, and find_nearby_pois/poi_details form a clear list-to-detail flow. The routing tools could feel similar at first glance, but their descriptions explicitly disambiguate single ordered routes, many-to-many matrices, and stop reordering.
Most multi-word names use a predictable snake_case style: reverse_geocode, route_matrix, find_nearby_pois, straight_line_distance. The set does mix verb-led names like find_nearby_pois and optimize_route with noun-led names like isochrone, poi_details, and map_link, but the overall pattern is still clear and readable.
With 11 tools, the server is well within the ideal range and each tool earns its place by covering a distinct geospatial capability. None of the tools feel redundant, and the count is appropriate for a domain spanning geocoding, routing, POI search, and map links.
The tool set covers the full common workflow for an OSM-based location server: forward and reverse geocoding, routes, matrices, route optimization, isochrones, POI discovery and details, meeting-point suggestions, straight-line distance, and shareable map links. Results from earlier tools feed naturally into later tools, such as POI ids into poi_details and places into route or map_link, leaving no obvious dead ends.
Maintenance
Related MCP Connectors
Geocoding, routing, isochrones, traffic, weather, and place search for AI agents. 19 MCP tools.
Maps, geocoding and time zones for AI coding agents, on OpenStreetMap, with hard prepaid spend caps.
Hosted MCP for live place search, geocoding & turn-by-turn routes. No Maps API key to manage.
Geocoding, static maps and privacy-safe area maps from OpenStreetMap data. Hard caps, no overage.
Related MCP Servers
- AlicenseBqualityDmaintenanceA comprehensive MCP server providing 30 tools for geocoding, routing, and OpenStreetMap data analysis. It enables AI assistants to search for locations, calculate travel routes, and perform quality assurance checks on map data.306MIT
- AlicenseNot gradedqualityCmaintenanceFree geospatial MCP server for AI agents, providing geocoding, reverse geocoding, POI search, and route planning using OpenStreetMap data via Nominatim, Overpass, and OSRM.GPL 3.0
- FlicenseNot gradedqualityBmaintenanceAn MCP server providing geocoding, routing, isochrones, and POI-by-proximity search through self-hosted OpenStreetMap backends.-
- AlicenseNot gradedqualityCmaintenanceMCP server for geocoding, reverse geocoding, place/POI search, and distance calculation using OpenStreetMap Nominatim, with no API key required.89 npm1MIT