# openstreetmap-mcp-server

Brings OpenStreetMap geocoding, reverse lookups, and Overpass spatial queries to AI coding tools. Supports remote streamable HTTP or local stdio.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 8
- Author: cyanheads
- License: Apache-2.0 · policy=link-only · description only; the file stays with the author
- Source: https://github.com/cyanheads/openstreetmap-mcp-server
- Updated: 2026-10-17
- HTML: https://affpapa.org/en/nevibecode/mcp/openstreetmap-mcp-server

## What it does

The server exposes six tools connecting your assistant to Nominatim and the Overpass API. It handles forward geocoding by place name or split address fields, reverse geocoding from latitude and longitude, and batch lookups by OpenStreetMap entity identifiers with N, W, or R prefixes. If predefined filters fall short, `openstreetmap_query_raw` executes arbitrary Overpass QL code with up to 256 MiB response budgets.

Spatial discovery features support radius searches up to 50,000 meters, bounding boxes, and queries constrained within boundary relations. Tag filters match exact values or individual items in semicolon-delimited lists. Responses include distance calculations sorted from the nearest feature outward.

You can connect directly to the hosted server at `https://openstreetmap.caseyjhand.com/mcp` or run `@cyanheads/openstreetmap-mcp-server` locally via `npx`. When running locally over stdio, configuring `OSM_USER_AGENT` is essential to prevent upstream Nominatim rejections.

## Requirements
- Needs: Node.js (commands run via npx)
- Remote server: `https://openstreetmap.caseyjhand.com/mcp`
- Environment variables: `OSM_NOMINATIM_BASE_URL`, `OSM_USER_AGENT`, `OSM_OVERPASS_BASE_URL`, `OSM_OVERPASS_ENDPOINTS`, `OSM_OVERPASS_MAX_CONCURRENCY`, `MCP_LOG_LEVEL`, `MCP_TRANSPORT_TYPE`, `MCP_HTTP_HOST`, `MCP_HTTP_PORT`, `MCP_HTTP_ENDPOINT_PATH` — keys and tokens: ask the human for the values, never commit them or put them in shared files.

## Install

### Claude Code (native platform)

1. **Platform CLI: remote server**
```bash
claude mcp add --transport http openstreetmap-mcp-server https://openstreetmap.caseyjhand.com/mcp
```

2. **Platform CLI**
```bash
claude mcp add --env OSM_NOMINATIM_BASE_URL=<OSM_NOMINATIM_BASE_URL> --env OSM_USER_AGENT=<OSM_USER_AGENT> --env OSM_OVERPASS_BASE_URL=<OSM_OVERPASS_BASE_URL> --env OSM_OVERPASS_ENDPOINTS=<OSM_OVERPASS_ENDPOINTS> --env OSM_OVERPASS_MAX_CONCURRENCY=<OSM_OVERPASS_MAX_CONCURRENCY> --transport stdio openstreetmap-mcp-server -- npx -y @cyanheads/openstreetmap-mcp-server
```
Replace <…> with your own values. 7 more environment variables are in the server README

### Codex

1. **Platform CLI: remote server**
```bash
codex mcp add openstreetmap-mcp-server --url https://openstreetmap.caseyjhand.com/mcp
```

2. **Platform CLI**
```bash
codex mcp add openstreetmap-mcp-server --env OSM_NOMINATIM_BASE_URL=<OSM_NOMINATIM_BASE_URL> --env OSM_USER_AGENT=<OSM_USER_AGENT> --env OSM_OVERPASS_BASE_URL=<OSM_OVERPASS_BASE_URL> --env OSM_OVERPASS_ENDPOINTS=<OSM_OVERPASS_ENDPOINTS> --env OSM_OVERPASS_MAX_CONCURRENCY=<OSM_OVERPASS_MAX_CONCURRENCY> -- npx -y @cyanheads/openstreetmap-mcp-server
```
Replace <…> with your own values. 7 more environment variables are in the server README

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "openstreetmap-mcp-server": {
            "url": "https://openstreetmap.caseyjhand.com/mcp"
        }
    }
}
```
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "openstreetmap-mcp-server": {
            "command": "npx",
            "args": [
                "-y",
                "@cyanheads/openstreetmap-mcp-server"
            ],
            "env": {
                "OSM_NOMINATIM_BASE_URL": "<OSM_NOMINATIM_BASE_URL>",
                "OSM_USER_AGENT": "<OSM_USER_AGENT>",
                "OSM_OVERPASS_BASE_URL": "<OSM_OVERPASS_BASE_URL>",
                "OSM_OVERPASS_ENDPOINTS": "<OSM_OVERPASS_ENDPOINTS>",
                "OSM_OVERPASS_MAX_CONCURRENCY": "<OSM_OVERPASS_MAX_CONCURRENCY>"
            }
        }
    }
}
```
Replace <…> with your own values. 7 more environment variables are in the server README

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "openstreetmap-mcp-server": {
            "type": "http",
            "url": "https://openstreetmap.caseyjhand.com/mcp"
        }
    }
}
```
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "openstreetmap-mcp-server": {
            "type": "stdio",
            "command": "npx",
            "args": [
                "-y",
                "@cyanheads/openstreetmap-mcp-server"
            ],
            "env": {
                "OSM_NOMINATIM_BASE_URL": "<OSM_NOMINATIM_BASE_URL>",
                "OSM_USER_AGENT": "<OSM_USER_AGENT>",
                "OSM_OVERPASS_BASE_URL": "<OSM_OVERPASS_BASE_URL>",
                "OSM_OVERPASS_ENDPOINTS": "<OSM_OVERPASS_ENDPOINTS>",
                "OSM_OVERPASS_MAX_CONCURRENCY": "<OSM_OVERPASS_MAX_CONCURRENCY>"
            }
        }
    }
}
```
Replace <…> with your own values. 7 more environment variables are in the server README

### Gemini CLI

1. **Platform CLI: remote server**
```bash
gemini mcp add -t http openstreetmap-mcp-server https://openstreetmap.caseyjhand.com/mcp
```

2. **Platform CLI**
```bash
gemini mcp add -e OSM_NOMINATIM_BASE_URL=<OSM_NOMINATIM_BASE_URL> -e OSM_USER_AGENT=<OSM_USER_AGENT> -e OSM_OVERPASS_BASE_URL=<OSM_OVERPASS_BASE_URL> -e OSM_OVERPASS_ENDPOINTS=<OSM_OVERPASS_ENDPOINTS> -e OSM_OVERPASS_MAX_CONCURRENCY=<OSM_OVERPASS_MAX_CONCURRENCY> openstreetmap-mcp-server npx -y @cyanheads/openstreetmap-mcp-server
```
Replace <…> with your own values. 7 more environment variables are in the server README

## When to use it
- convert addresses and place names into geographic coordinates
- resolve latitude and longitude coordinates into street addresses
- find nearby amenities and tagged features within a custom radius
- retrieve full node, way, and relation details using OSM identifiers
- execute custom Overpass QL statements against spatial map data

## Example prompts
- Find the coordinates and postal code for Alexanderplatz in Berlin using openstreetmap_search_places.
- List all coffee shops within 1000 meters of coordinates 52.5200, 13.4050.
- Query OpenStreetMap features inside the bounding box south 40.7, west -74.0, north 40.8, east -73.9.

## Similar
- [World Monitor](https://affpapa.org/en/nevibecode/mcp/world-monitor.md) — MCP server · ★ 89408
- [Scrapling MCP Server](https://affpapa.org/en/nevibecode/mcp/scrapling-mcp-server.md) — MCP server · ★ 89433
- [MCP Toolbox for Databases](https://affpapa.org/en/nevibecode/mcp/googleapis-mcp-toolbox-for-databases.md) — MCP server · ★ 16717
- [PostHog MCP Server](https://affpapa.org/en/nevibecode/mcp/posthog-mcp-server.md) — MCP server · ★ 40409
- [dbx](https://affpapa.org/en/nevibecode/mcp/dbx.md) — MCP server · ★ 27669
- [Metabase](https://affpapa.org/en/nevibecode/mcp/metabase.md) — MCP server · ★ 49845

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