Skip to main content
MCP server CX Codex

OpenStreetMap — Claude Code MCP server: what it does, how to install

OpenStreetMap is an MCP server that integrates geographic data and routing tools into your AI agent. It handles travel planning, geocoding, and location queries via OSM services.

MIT ★ 6 updated 2026-11-17

Install into Claude Code · Platform CLI All methods and platforms ↓
claude mcp add --env OSM_USER_AGENT=<OSM_USER_AGENT> --env ORS_API_KEY=<ORS_API_KEY> --env OSM_ALLOW_TOOLS=<OSM_ALLOW_TOOLS> --env OSM_DENY_TOOLS=<OSM_DENY_TOOLS> --transport stdio openstreetmap -- npx -y osm-mcp
Open on GitHub

What OpenStreetMap does

The server provides 11 read-only tools for geocoding, distance calculations, route optimization, and POI search. It differentiates between walking, cycling, and driving profiles, ensuring accurate travel times for non-car routes. To maintain compliance with service policies, it implements rate limiting, request caching, and automatic failover for API calls.

Running this requires Node.js 24 or later and an active internet connection. While it works out of the box using public OpenStreetMap backends, you can optionally provide an ORS_API_KEY to utilize alternative routing engines. You may also limit the toolset to six core functions via OSM_ALLOW_TOOLS for improved model reliability.

What it helps with

  • calculate walking route distances
  • geocode addresses to coordinates
  • optimize multi-stop travel paths
  • retrieve isochrone data for locations

Example prompts for the agent

  • Find a walking route between the train station and the city center.
  • Estimate driving time for the planned route.
  • List all coffee shops within 1km of my current location.

How to install OpenStreetMap

Platform CLI

claude mcp add --env OSM_USER_AGENT=<OSM_USER_AGENT> --env ORS_API_KEY=<ORS_API_KEY> --env OSM_ALLOW_TOOLS=<OSM_ALLOW_TOOLS> --env OSM_DENY_TOOLS=<OSM_DENY_TOOLS> --transport stdio openstreetmap -- npx -y osm-mcp

Replace <…> with your own values

Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more

Questions about OpenStreetMap

How to install OpenStreetMap in Claude Code?

Run claude mcp add osm-mcp -e ORS_API_KEY=<ORS_API_KEY> -- npx -y osm-mcp in your terminal.

What does OpenStreetMap do?

It enables your AI agent to perform geocoding, calculate travel distances, generate routes, and search for points of interest using OpenStreetMap data.

What do I need to run OpenStreetMap?

You need Node.js 24+ and internet access. No API key is required, though you can provide an optional ORS_API_KEY for advanced routing.

Similar MCP servers

All MCP servers for Agent setup: memory, context, orchestration →

Project sponsors

Companies that keep this analytics open