openstreetmap-mcp-server — Claude Code MCP server: install and use
Brings OpenStreetMap geocoding, reverse lookups, and Overpass spatial queries to AI coding tools. Supports remote streamable HTTP or local stdio.
claude mcp add --transport http openstreetmap-mcp-server https://openstreetmap.caseyjhand.com/mcpWhat openstreetmap-mcp-server 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.
What it helps with
- 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 for the agent
- 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.
How to install openstreetmap-mcp-server
1Platform CLI: remote server
claude mcp add --transport http openstreetmap-mcp-server https://openstreetmap.caseyjhand.com/mcp2Platform CLI
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-serverReplace <…> with your own values. 7 more environment variables are in the server README
1Platform CLI: remote server
codex mcp add openstreetmap-mcp-server --url https://openstreetmap.caseyjhand.com/mcp2Platform CLI
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-serverReplace <…> with your own values. 7 more environment variables are in the server README
Config file
{
"mcpServers": {
"openstreetmap-mcp-server": {
"url": "https://openstreetmap.caseyjhand.com/mcp"
}
}
}{
"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
Config file
{
"servers": {
"openstreetmap-mcp-server": {
"type": "http",
"url": "https://openstreetmap.caseyjhand.com/mcp"
}
}
}{
"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
1Platform CLI: remote server
gemini mcp add -t http openstreetmap-mcp-server https://openstreetmap.caseyjhand.com/mcp2Platform CLI
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-serverReplace <…> with your own values. 7 more environment variables are in the server README
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-mcp-server
How to install openstreetmap-mcp-server in Claude Code?
Add the hosted endpoint with claude mcp add --transport http openstreetmap-mcp-server https://openstreetmap.caseyjhand.com/mcp. Alternatively, configure local stdio execution with `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`.
What does openstreetmap-mcp-server do?
It provides programmatic access to OpenStreetMap data via Nominatim and Overpass API. Assistants can geocode locations, resolve coordinates to addresses, and extract geographic features.
What limits apply to queries and object lookups?
Nearby searches accept a maximum radius of 50,000 meters and return up to 500 features per call. Object lookups support batches of up to 500 IDs but fetch the first 50 unique items initially, deferring the rest.