Skip to main content
Glama

osm-mcp

CI npm version npm downloads node Container license Docs

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-car werden 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

OSM_USER_AGENT

osm-mcp/<version> (+https://github.com/ni-c/osm-mcp)

User-Agent, der an jeden Dienst gesendet wird. Nominatim erfordert einen echten, identifizierenden.

NOMINATIM_BASE_URL

https://nominatim.openstreetmap.org

Geokodierung / Reverse-Geokodierung

PHOTON_BASE_URL

https://photon.komoot.io

Tippfehlertolerante Geokodierung

OSRM_BASE_URL

https://routing.openstreetmap.de

Routing, Matrizen, Tourenoptimierung. Muss die Pfadpräfixe routed-{car,bike,foot} bereitstellen (das FOSSGIS-Layout).

OVERPASS_BASE_URL

https://overpass-api.de/api/interpreter,https://overpass.private.coffee/api/interpreter

Kommagetrennte Overpass-Endpunkte, die bei 429/5xx der Reihe nach probiert werden

VALHALLA_BASE_URL

https://valhalla1.openstreetmap.de

Isochronen

ORS_API_KEY

–

Optionaler OpenRouteService-Schlüssel (geheim). Wenn gesetzt, verwenden Routen, Matrizen und Isochronen ORS anstelle von OSRM/Valhalla. Kostenloses Kontingent: 2000 Richtungen/Tag, 40/Minute.

ORS_BASE_URL

https://api.openrouteservice.org

OpenRouteService-Endpunkt

OSM_CACHE_TTL

3600

Sekunden, die identische Upstream-Antworten aus dem Arbeitsspeicher-Cache ausgeliefert werden (0 deaktiviert Caching)

Installieren

claude mcp add osm -- npx -y osm-mcp

Claude 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

geocode

Ortsname/Adresse → Koordinaten (Nominatim oder Photon)

reverse_geocode

Koordinaten → nächste Adresse

route

Entfernung und Dauer zwischen 2+ Wegpunkten, foot/car/bike; optionale Abbiege-Zusammenfassung

route_matrix

Reisezeit/Entfernung von jedem Start zu jedem Ziel in einem Aufruf

optimize_route

Beste Besuchsreihenfolge für eine Reihe von Stopps (Traveling-Salesman, OSRM-Trip)

isochrone

Erreichbares Gebiet innerhalb eines Zeit- oder Entfernungsbudgets (Valhalla oder ORS mit Schlüssel)

find_nearby_pois

POIs in der Umgebung eines Ortes nach Kategorie oder rohem OSM-Tag, sortiert nach Entfernung (Overpass)

poi_details

Vollständiger OSM-Datensatz eines Elements: Öffnungszeiten, Website, Telefon, …

suggest_meeting_point

Geeigneter Treffpunkt für 2–8 Personen (ausgeglichene Reisezeiten)

straight_line_distance

Großkreisentfernung, offline berechnet

map_link

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_KEY wird 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 services

Veröffentlichung

Tag-gesteuert, kein manueller Veröffentlichungsschritt:

  1. Verschieben Sie die Einträge aus [Unreleased] in einen neuen Abschnitt ## [x.y.z] - YYYY-MM-DD in CHANGELOG.md und erhöhen Sie die Version in package.json.

  2. npm run lint && npm run build && npm run test:coverage.

  3. Committen, dann einen signierten annotierten Tag: git tag -s vx.y.z -m "vx.y.z".

  4. 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

MIT

Available Tools

11 tools
find_nearby_poisFind nearby places (POIs)A
Read-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 addressA
Read-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)A
Read-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

optimize_routeOptimize stop orderA
Read-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 detailsA
Read-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 coordinatesA
Read-onlyIdempotent

Converts coordinates into the nearest address or place name (Nominatim).

Inputs: latitude (required), longitude (required), language. Returns: note, result, source, untrusted

routeRoute between placesA
Read-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 matrixA
Read-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 distanceA
Read-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 pointA
Read-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

    A4.3/5.0

    Scored across 11 tools

    Disambiguation5/5

    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.

    Naming Consistency4/5

    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.

    Tool Count5/5

    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.

    Completeness5/5

    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

    ActivityNo data
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      D
      maintenance
      A 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.
      30
      6
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Free 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
    • A
      license
      Not graded
      quality
      C
      maintenance
      MCP server for geocoding, reverse geocoding, place/POI search, and distance calculation using OpenStreetMap Nominatim, with no API key required.
      89 npm
      1
      MIT