osm-mcp
Provides typo-tolerant geocoding via komoot's Photon service for better LLM-driven place searches.
Provides geocoding, reverse geocoding, routing (walking, driving, cycling), distance matrices, multi-stop route optimization, isochrones, and POI search using OpenStreetMap data through services like Nominatim, Photon, OSRM, Valhalla, and Overpass.
Offers typo-tolerant geocoding as an alternative to Nominatim for more interactive place name lookups.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@osm-mcpplan a walking tour from the Louvre to the Eiffel Tower with 3 scenic stops along the Seine"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
osm-mcp
An MCP server for OpenStreetMap: geocoding, walking/driving/cycling distances and durations, multi-stop route optimization, isochrones and POI search — built for travel planning with AI assistants.
11 tools, all read-only. All backends are free public OpenStreetMap services; no API key is required. An OpenRouteService key can be supplied optionally to switch the routing engine.
📖 Full documentation: https://osm-mcp.ni-c.de
Why another OSM MCP server?
Correct walking/cycling routes. The public OSRM demo servers ignore the profile segment inside the OSRM URL path and always return car routes unless the FOSSGIS
routed-foot/routed-bike/routed-carpath prefixes are used. Most existing OSM MCP servers get this wrong and silently return driving times for walking queries. This server uses the prefixes and its live smoke test asserts that foot routes are much slower than car routes.Policy-compliant by construction. Per-service rate limiting (Nominatim and OSRM: 1 request/second), an identifying User-Agent on every request (required by the Nominatim usage policy), response caching, capped Overpass concurrency (2 slots) and automatic failover to an Overpass mirror on 429/5xx.
Photon support. Optional typo-tolerant geocoding via komoot's Photon, which is designed for interactive use — a better fit for LLM-driven lookups than hammering Nominatim.
Related MCP server: Geo MCP Worker
Requirements
Node.js ≥ 22
Internet access to the public OpenStreetMap services (see table below)
Configuration
Every variable is optional — the server works out of the box.
Variable | Default | Description |
|
| User-Agent sent to every service. Nominatim requires a real, identifying one. |
|
| Geocoding / reverse geocoding |
|
| Typo-tolerant geocoding |
|
| Routing, matrices, trip optimization. Must serve the |
|
| Comma-separated Overpass endpoints, tried in order on 429/5xx |
|
| Isochrones |
| – | Optional OpenRouteService key (secret). When set, routes, matrices and isochrones use ORS instead of OSRM/Valhalla. Free tier: 2000 directions/day, 40/minute. |
|
| OpenRouteService endpoint |
|
| Seconds identical upstream responses are served from the in-memory cache ( |
Install
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, with SBOM and build provenance):
docker run -i --rm ghcr.io/ni-c/osm-mcp-i is required — the protocol runs over stdin and stdout. There is no port to
publish. More client recipes are in the
client guide.
Tools
Tool | Description |
| Place name/address → coordinates (Nominatim or Photon) |
| Coordinates → nearest address |
| Distance and duration between 2+ waypoints, |
| Travel time/distance from every origin to every destination in one call |
| Best visiting order for a set of stops (traveling-salesman, OSRM trip) |
| Reachable area within a time or distance budget (Valhalla, or ORS with key) |
| POIs around a location by category or raw OSM tag, sorted by distance (Overpass) |
| Full OSM record of one element: opening hours, website, phone, … |
| Fair meeting venue for 2–8 people (balanced travel times) |
| Great-circle distance, computed offline |
| openstreetmap.org marker / directions links, computed offline |
Every place input accepts either a name/address (geocoded automatically) or
literal coordinates as "lat,lon".
Usage policies & attribution
This server talks to shared community infrastructure. It enforces the published limits client-side, but the operator asks users to keep overall usage light and non-commercial:
Data: © OpenStreetMap contributors, licensed under ODbL 1.0.
Nominatim: max 1 request/second, identifying User-Agent mandatory, results cached (policy).
OSRM / Valhalla (FOSSGIS): reasonable, non-commercial use; max 1 request/second (about).
Overpass: ~2 concurrent slots per IP, <10 000 queries/day (wiki).
Photon: fair use (photon.komoot.io).
For heavy or commercial use, self-host the services and point the
*_BASE_URL variables at your instances.
Safety
All tools are read-only; the server never writes to OpenStreetMap.
No credentials are required; the optional
ORS_API_KEYis removed from the process environment after loading and redacted from error messages.OSM-sourced content (names, addresses, tags) is marked as untrusted data in tool results so the model treats it as data, not instructions.
Upstream error bodies are truncated and HTML error pages dropped before they reach the model context.
Redirects are never followed; all requests time out.
Development
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 servicesReleasing
Tag-driven, no manual publish step:
Move the
[Unreleased]entries into a new## [x.y.z] - YYYY-MM-DDsection inCHANGELOG.mdand bumppackage.json.npm run lint && npm run build && npm run test:coverage.Commit, then a signed annotated tag:
git tag -s vx.y.z -m "vx.y.z".git push origin main vx.y.z.
release.yml then runs the tests, publishes to npm with provenance via Trusted
Publishing (no token secret involved), creates the GitHub release from the
CHANGELOG section, and publishes to the
MCP registry as
io.github.ni-c/osm-mcp. ci.yml pushes the multi-arch image to GHCR on the
same tag.
If the registry step fails, fix it on main and dispatch the
Publish to MCP Registry workflow — do not re-run the tag job, which would
check out the old tree.
License
Maintenance
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.303MIT
- Alicense-qualityBmaintenanceFree geospatial MCP server for AI agents, providing geocoding, reverse geocoding, POI search, and route planning using OpenStreetMap data via Nominatim, Overpass, and OSRM.1GPL 3.0
- Flicense-qualityAmaintenanceAn MCP server providing geocoding, routing, isochrones, and POI-by-proximity search through self-hosted OpenStreetMap backends.
- Alicense-qualityAmaintenanceMCP server for geocoding, reverse geocoding, place/POI search, and distance calculation using OpenStreetMap Nominatim, with no API key required.183MIT
Related MCP Connectors
MCP server for Japan geodata: cadastral lot numbers (chiban) and reverse geocoding, for AI agents.
Hosted MCP server for LLM cost estimation, model comparison, and budget-aware routing.
AI marketplace — flights, tours, activities, transport & more via MCP. No auth required.
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/ni-c/osm-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server