# OpenStreetMap

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.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 6 repo stars
- Author: ni-c
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/ni-c/osm-mcp
- Updated: 2026-11-17
- Security check: automated, 2026-11-17 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/mcp/openstreetmap

## What it 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.

## Requirements
- Needs: Node.js (commands run via npx)
- Environment variables: `OSM_USER_AGENT`, `ORS_API_KEY`, `OSM_ALLOW_TOOLS`, `OSM_DENY_TOOLS` — keys and tokens: ask the human for the values, never commit them or put them in shared files.

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
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

### Codex

**Platform CLI**
```bash
codex mcp add openstreetmap --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> -- npx -y osm-mcp
```
Replace <…> with your own values

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "openstreetmap": {
            "command": "npx",
            "args": [
                "-y",
                "osm-mcp"
            ],
            "env": {
                "OSM_USER_AGENT": "<OSM_USER_AGENT>",
                "ORS_API_KEY": "<ORS_API_KEY>",
                "OSM_ALLOW_TOOLS": "<OSM_ALLOW_TOOLS>",
                "OSM_DENY_TOOLS": "<OSM_DENY_TOOLS>"
            }
        }
    }
}
```
Replace <…> with your own values

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "openstreetmap": {
            "type": "stdio",
            "command": "npx",
            "args": [
                "-y",
                "osm-mcp"
            ],
            "env": {
                "OSM_USER_AGENT": "<OSM_USER_AGENT>",
                "ORS_API_KEY": "<ORS_API_KEY>",
                "OSM_ALLOW_TOOLS": "<OSM_ALLOW_TOOLS>",
                "OSM_DENY_TOOLS": "<OSM_DENY_TOOLS>"
            }
        }
    }
}
```
Replace <…> with your own values

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add -e OSM_USER_AGENT=<OSM_USER_AGENT> -e ORS_API_KEY=<ORS_API_KEY> -e OSM_ALLOW_TOOLS=<OSM_ALLOW_TOOLS> -e OSM_DENY_TOOLS=<OSM_DENY_TOOLS> openstreetmap npx -y osm-mcp
```
Replace <…> with your own values

## When to use it
- calculate walking route distances
- geocode addresses to coordinates
- optimize multi-stop travel paths
- retrieve isochrone data for locations

## Example prompts
- 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.

## Similar
- [maps](https://affpapa.org/en/nevibecode/skills/maps.md) — skill · 437 installs
- [openstreetmap-mcp-server](https://affpapa.org/en/nevibecode/mcp/openstreetmap-mcp-server.md) — MCP server · ★ 9 repo stars
- [mcp-server](https://affpapa.org/en/nevibecode/mcp/mapbox-mcp-server.md) — MCP server · ★ 373 repo stars
- [azure-maps](https://affpapa.org/en/nevibecode/skills/azure-maps.md) — skill · 178 installs
- [GrabMaps MCP Server](https://affpapa.org/en/nevibecode/mcp/grabmaps-mcp-server.md) — MCP server · 1825 installs
- [agentgeo](https://affpapa.org/en/nevibecode/mcp/agentgeo.md) — MCP server · 2313 installs

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
