Purpose
osm-mcp is a Model Context Protocol (MCP) server for OpenStreetMap, purpose-built for travel planning. It enables MCP clients such as Claude Code, Claude Desktop, and Codex to answer questions about places, including: geocoding, walking/driving/cycling distances and durations, multi-stop route optimization, isochrones, and points of interest (POI) search.
Main Capabilities
The server provides 11 tools in total, all read-only. The 11 tools are an upper limit rather than a lower limit: via OSM_ALLOW_TOOLS=essential, a curated subset of 6 tools can be registered, and a model picking the right tool from 6 tools is far more reliable than picking from 11.
Project features include:
- Correct walking/cycling routes: The public OSRM demo server ignores the profile segment in the OSRM URL path, and always returns car routes unless the FOSSGIS routed-foot / routed-bike / routed-car path prefixes are used. Many existing OSM MCP servers make this mistake, silently returning driving times for walking queries. This server uses the correct prefixes, and its smoke tests assert that walking routes are much slower than driving routes.
- Policy-compliant design: Per-service rate limiting (1 request/second for Nominatim and OSRM), an identifying User-Agent with every request (required by the Nominatim usage policy), response caching, limiting Overpass concurrency (2 slots), and automatic failover to Overpass mirrors on 429/5xx.
- Photon support: Optional fault-tolerant geocoding, implemented via komoot's Photon, designed for interactive use and better suited to LLM-driven lookups than hammering Nominatim.
An internet connection with access to public OpenStreetMap services is required. All environment variables are optional—the server works out of the box.
Usage
Choose which tools to load: OSM_ALLOW_TOOLS and OSM_DENY_TOOLS accept comma-separated tool names; a trailing * matches an entire family. essential is a curated preset of 6 tools: geocode, reverse_geocode, find_nearby_pois, poi_details, route, map_link. An entry that does not match any tool will cause startup to abort and point out that entry, so spelling mistakes will not silently hide tools. Filtered tools are never registered, so they neither appear in tools/list nor are known to tools/call.
If multiple such servers are running at the same time, mcp-hub is another option—its /hub endpoint replaces each server's tools with 6 meta-tools.
Configuration example (claude_desktop_config.json or ~/.codex/config.toml format). Running the container requires the -i flag—the protocol runs over stdin and stdout, and there is no port to publish. Clients that cannot spawn local processes (ChatGPT connectors, web version Claude, Cursor, LibreChat) access osm-mcp through mcp-hub: one container serves multiple stdio MCP servers over Streamable HTTP, with OAuth 2.1 login, a single password, and long-lived tokens.
Each place input accepts a name/address (automatic geocoding) or literal coordinates "lat,lon".
Structured output: every tool declares outputSchema and returns structuredContent alongside the text block, so clients can use the results without parsing prose. Every tool carries untrusted: true and source: "openstreetmap"—there is no exception list, because OpenStreetMap can be edited by anyone on Earth.
Use cases
- Place lookup, route calculation, and multi-point optimization in travel planning
- Geocoding and points-of-interest search through MCP clients
- Isochrone analysis and walking/cycling route comparison
Limitations
Usage policy and attribution: this server communicates with shared community infrastructure. It enforces the published rate limits on the client side, but operators require users to keep overall usage lightweight and non-commercial:
- Data: © OpenStreetMap contributors, licensed under ODbL 1.0.
- Nominatim: maximum 1 request/second, must include an identifying User-Agent,Result caching.
- OSRM / Valhalla (FOSSGIS): reasonable, non-commercial use; maximum 1 request/second.
- Overpass: about 2 concurrent slots per IP, fewer than 10,000 queries per day.
- Photon: reasonable use (photon.komoot.io).
For heavy or commercial use, self-host the services and point the *_BASE_URL variables to your own instances.
Features intentionally not exposed:
- No editing functionality. All 11 tools are read-only for OpenStreetMap; the editing API is not integrated at all, so there is no write mode to turn off.
- No rendering, no tracking. Results are structured data plus links, not images—map_link gives you a URL to view the map yourself—and there is no state between calls.
- No offline mode. Every answer comes from public OpenStreetMap services and is subject to their usage policies.
Security notes: all tools are read-only; the server never writes to OpenStreetMap. No credentials are required; the optional ORS_API_KEY is removed from the process environment after loading and redacted in error messages. OSM-sourced content (names, addresses, tags) is marked as untrusted data in tool results so that the model treats it as data rather than instructions. Upstream error bodies are truncated, and HTML error pages are discarded before reaching the model context; the HTTP status is decided before reading the body. Every value returned by the service is shaped before reaching the result: finite numbers, bounded strings, and a single malformed element is discarded rather than the entire list. Redirects are never followed; all requests have timeouts.
The release process is tag-driven with no manual release step: move the [Unreleased] entries into a new ## [x.y.z] - YYYY-MM-DD subsection in CHANGELOG.md and update package.json; run lint, build, and test:coverage; after committing, create a signed annotated tag with git tag -s vx.y.z -m "vx.y.z"; push. release.yml then runs the tests, publishes to npm via Trusted Publishing (no token secret), creates a GitHub release from the CHANGELOG subsection, and publishes to the MCP registry (io.github.ni-c/osm-mcp).ci.yml pushes multi-architecture images to GHCR on the same tag.
License: MIT © Willi Thiel. The full guide, tool reference, and security notes are at osm-mcp.ni-c.de (source in docs/).
Other details (such as specific installation commands, container image names, and complete client configuration snippets) are not fully expanded in the provided material and are not provided for now.