@cyanheads/openstreetmap-mcp-server
Provides tools for geocoding, reverse geocoding, and spatial queries against OpenStreetMap data, enabling agents to search places, query nearby features, and execute Overpass QL queries.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@@cyanheads/openstreetmap-mcp-serverGeocode the address of the White House"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Public Hosted Server: https://openstreetmap.caseyjhand.com/mcp
Tools
6 tools for geocoding and spatial queries against OpenStreetMap data:
Tool | Description |
| Convert a place name or address to geographic coordinates and structured place data |
| Convert latitude/longitude coordinates to the nearest address or place name |
| Fetch address details for one or more known OSM objects by their IDs |
| Find OSM features within a radius around a geographic point |
| Find OSM features within a rectangular bounding box |
| Execute a raw Overpass QL query for advanced spatial operations |
openstreetmap_search_places
Convert a place name or address to geographic coordinates via Nominatim/OpenStreetMap.
Two input modes: free-form query string (e.g.,
"Space Needle Seattle") or structured address fields (street, city, state, country, postal code) — mutually exclusiveCountry filtering via ISO 3166-1 alpha-2 codes (
countrycodes)Data layer filtering: address, poi, railway, natural, manmade
Feature type restriction: country, state, city, settlement
Optional extra OSM tags (phone, website, opening_hours, wikidata)
Preferred language override via BCP 47 code
Returns results ordered by Nominatim importance score (global prominence)
Results include coordinates, structured address, bounding box, OSM type/ID for chaining into
openstreetmap_lookup_objects
openstreetmap_reverse_geocode
Convert latitude/longitude to the nearest address or named place.
Zoom-level control for address detail: 18=building, 16=street, 14=neighbourhood, 12=town, 10=city, 8=county, 5=state, 3=country
Layer filtering for matched OSM object type
Optional extra OSM tags and language preference
Returns structured address breakdown, OSM type/ID, and bounding box
openstreetmap_lookup_objects
Fetch full Nominatim address records for known OSM object IDs.
Accepts an array of up to 50 IDs; a single ID is passed wrapped, e.g.
["N240109189"]IDs must be prefixed with N (node), W (way), or R (relation): e.g.,
"N240109189","W50637691","R146656"Efficient alternative to a full geocoding round-trip when OSM IDs are already known (e.g., from an Overpass result)
Reports
not_foundlist for IDs that returned no resultOptional extra OSM tags and language preference
openstreetmap_query_nearby
Find OSM features within a radius around a point via the Overpass API.
Primary tool for "what's near X?" spatial queries
Supports
amenityshortcut for common POI types (hospital, pharmacy, restaurant, cafe, school, atm) ortag_key+tag_valuefor any OSM category (leisure=park, shop=supermarket, natural=peak)Configurable radius up to 50km; keep under 5km for dense urban POI queries
Element type filtering: node (standalone POIs), way (buildings/areas), relation (complex structures)
Limit up to 500 results;
truncatedflag signals when more existReturns OSM type/ID, coordinates, name, and full tag set for each feature
openstreetmap_query_bbox
Find OSM features within a rectangular geographic bounding box.
Useful for area surveys where proximity to a single point isn't the goal
Same
amenity/tag_key+tag_valueinterface asopenstreetmap_query_nearbyA
westgreater thaneastis a box crossing the antimeridian, coveringwest..180plus-180..east; onlysouthgreater thannorthis rejectedConfigurable timeout for large bounding boxes or dense areas
Limit up to 500 results with
truncatedflag
openstreetmap_query_raw
Execute arbitrary Overpass QL for queries the convenience tools don't cover.
Full Overpass QL expressiveness: multi-type queries, union queries, relation membership, historical queries
Query must include
[out:json]; server injects[timeout:N]if absentReturns raw element array — structure varies by query type (nodes have lat/lon, ways have nodes[], relations have members[])
Validate complex queries at overpass-turbo.eu before use
Related MCP server: Overture Maps MCP
Features
Built on @cyanheads/mcp-ts-core:
Declarative tool definitions — single file per tool, framework handles registration and validation
Unified error handling across all tools
Pluggable auth (
none,jwt,oauth)Swappable storage backends:
in-memory,filesystem,Supabase,Cloudflare KV/R2/D1Structured logging with optional OpenTelemetry tracing
Runs locally (stdio/HTTP) or on Cloudflare Workers from the same codebase
Nominatim/Overpass-specific:
Nominatim usage policy compliance: configurable
User-AgentviaOSM_USER_AGENT, rate-limit-aware request handlingOverpass slot budget respected client-side: concurrent submissions capped by
OSM_OVERPASS_MAX_CONCURRENCY, and a throttled endpoint fails fast rather than being re-submittedOpt-in Overpass endpoint failover: list mirrors in
OSM_OVERPASS_ENDPOINTSand a transient failure advances to the next one inside the same call. Deterministic failures (malformed query, result too large) stay on one endpoint, and every response reports the endpoint that served itOSM attribution on every response (
Data © OpenStreetMap contributors, ODbL 1.0)Private instance support — override
OSM_NOMINATIM_BASE_URLandOSM_OVERPASS_BASE_URLfor self-hosted or mirror endpointsStructured error contracts:
no_results,no_coverage,invalid_input,invalid_id_format,invalid_tag,invalid_bbox,query_timeout,rate_limited,upstream_error,query_error,result_too_large,overpass_gateway_timeout,overpass_unavailable,endpoints_exhausted— all with actionable recovery hintsOverpass rejections carry the upstream cause: the whole error document is captured, so an Overpass 5xx surfaces its
runtime error: ...remark on every Overpass tool, and a malformedopenstreetmap_query_rawquery itsline N: parse error: ...detail, instead of a bare status
Agent-friendly output:
Attribution on every response — agents can surface the ODbL license notice as required
Structured output contracts — coordinates, OSM IDs, address fields, and tag maps in consistent shapes
Cross-tool chaining: Overpass results carry
osm_type+osm_idthat feed directly intoopenstreetmap_lookup_objectsfor full address records
Getting started
Self-Hosted / Local
Add the following to your MCP client configuration file.
{
"mcpServers": {
"openstreetmap-mcp-server": {
"type": "stdio",
"command": "bunx",
"args": ["@cyanheads/openstreetmap-mcp-server@latest"],
"env": {
"MCP_TRANSPORT_TYPE": "stdio",
"MCP_LOG_LEVEL": "info"
}
}
}
}Or with npx (no Bun required):
{
"mcpServers": {
"openstreetmap-mcp-server": {
"type": "stdio",
"command": "npx",
"args": ["-y", "@cyanheads/openstreetmap-mcp-server@latest"],
"env": {
"MCP_TRANSPORT_TYPE": "stdio",
"MCP_LOG_LEVEL": "info"
}
}
}
}For Streamable HTTP, set the transport and start the server:
MCP_TRANSPORT_TYPE=http MCP_HTTP_PORT=3010 bun run start:http
# Server listens at http://localhost:3010/mcpPrerequisites
Bun v1.3.0 or higher (or Node.js ≥24.0.0).
No API key required — Nominatim and Overpass are public APIs. For heavy use, consider pointing
OSM_NOMINATIM_BASE_URLandOSM_OVERPASS_BASE_URLat self-hosted or mirror instances.
Installation
Clone the repository:
git clone https://github.com/cyanheads/openstreetmap-mcp-server.gitNavigate into the directory:
cd openstreetmap-mcp-serverInstall dependencies:
bun installConfiguration
All configuration is validated at startup via Zod schemas in src/config/server-config.ts. Key environment variables:
Variable | Description | Default |
| Transport: |
|
| HTTP server port |
|
| HTTP endpoint path where the MCP server is mounted |
|
| Public origin override for TLS-terminating reverse-proxy deployments | none |
| Authentication: |
|
| Log level ( |
|
| Opt-in Bun-only forced-GC pressure loop (ms). Recommended starting point if heap growth is observed: |
|
| Storage backend: |
|
| Nominatim API base URL. Override for a private or mirror instance. A path prefix is supported for instances proxied under a subpath (e.g. |
|
| Overpass API endpoint URL. When set, pins every query to this one endpoint and disables mirror failover — what a private-instance deployment wants. Leave unset to use | unset |
| Comma-separated ordered list of Overpass endpoints. On a transient failure (5xx, HTML throttle page, connection timeout) the same tool call advances to the next entry, so a degraded endpoint costs latency instead of the answer; the first entry stays the preferred one. A single entry means no failover. Ignored when |
|
| Maximum Overpass queries submitted at once; queries past the cap queue locally. Match the slot budget the endpoint advertises at |
|
| User-Agent sent to Nominatim and Overpass. Required by usage policy. |
|
| Enable OpenTelemetry |
|
Overpass endpoint failover
Out of the box the server queries one Overpass endpoint, the FOSSGIS-operated main instance. A degraded endpoint therefore fails the call — openstreetmap_query_nearby, openstreetmap_query_bbox, and openstreetmap_query_raw all depend on it.
Listing more than one endpoint in OSM_OVERPASS_ENDPOINTS turns on failover: a transient failure advances to the next entry inside the same tool call, and the list is tried in order so the first entry stays preferred.
OSM_OVERPASS_ENDPOINTS="https://overpass-api.de/api/interpreter,https://overpass.private.coffee/api/interpreter"Failover is opt-in rather than the default because adding an endpoint sends your queries to a third party, on their terms and their bandwidth. Before listing one:
Confirm the operator welcomes general client use. The OSM wiki instance list records each instance's stated usage policy, and they differ sharply — some grant open use, others require an API key or payment, others ask you to contact the operator first.
overpass.private.coffee, for one, publishes a grant covering any project including commercial use, alongside prohibited-use terms and a request to be told in advance about large-scale use.Check the data coverage. Region-scoped instances answer a query outside their extract with HTTP 200 and an empty element list — a silent wrong answer rather than an error — so they are unfit as a general-purpose fallback no matter how healthy they are. The wiki list separates global instances from regional ones.
Check the freshness. Mirrors can lag the main instance, sometimes by weeks. Every response reports which endpoint served it in the
servingEndpointenrichment field alongside thedata_timestampoutput field, so a stale or unexpected result stays attributable.
OSM_USER_AGENT is sent to every endpoint, and its default identifies this server and its version, which is what the main instance's policy asks for. An endpoint you add is governed by its own policy as well.
Two other behaviors bound what a failover can cost. OSM_OVERPASS_MAX_CONCURRENCY is one budget across all endpoints, so rotating never raises the number of submissions in flight. And one tool call stops submitting once it has spent 120 seconds — per-attempt deadline, queue wait, and retry backoff all count against that — surfacing endpoints_exhausted rather than multiplying a 90-second per-attempt deadline by the retry budget.
Setting OSM_OVERPASS_BASE_URL pins that single endpoint and disables failover, unchanged from previous releases: a private or self-hosted instance is not interchangeable with a public mirror.
Running the server
Local development
Build and run the production version:
# One-time build bun run rebuild # Run the built server bun run start:http # or bun run start:stdioRun checks and tests:
bun run devcheck # Lints, formats, type-checks, and more bun run test # Runs the test suite
Project structure
Directory | Purpose |
| Tool definitions ( |
| Nominatim service layer — API client, search, reverse, lookup. |
| Overpass service layer — query builder, executor, element normalizer. |
| Server-specific environment variable parsing and validation with Zod. |
Development guide
See CLAUDE.md for development guidelines and architectural rules. The short version:
Handlers throw, framework catches — no
try/catchin tool logicUse
ctx.logfor logging,ctx.statefor storageRegister new tools and resources in the
createApp()arrays
Contributing
Issues and pull requests are welcome. Run checks and tests before submitting:
bun run devcheck
bun run testLicense
This project is licensed under the Apache 2.0 License. See the LICENSE file for details.
Map data from OpenStreetMap contributors, available under the Open Database License (ODbL).
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseAqualityCmaintenanceAn MCP server providing geocoding and place discovery services via Nominatim and OpenStreetMap. It enables users to perform forward and reverse geocoding, extract bounding boxes, and find nearby places or administrative hierarchies.Last updated10Apache 2.0
- Flicense-qualityBmaintenancePython MCP server for querying Overture Maps building footprint data via address search, building lookups, and nearby building listings.Last updated
- AlicenseAqualityCmaintenanceMCP server for geocoding and place discovery using OpenStreetMap data via Nominatim. Supports forward/reverse geocoding, bounding boxes, nearby places, batch geocoding, route waypoints, and administrative boundaries.Last updated10Apache 2.0
- Alicense-qualityDmaintenanceAn MCP server for forward geocoding via the Nominatim API (OpenStreetMap) with no API key required.Last updated8MIT
Related MCP Connectors
Nominatim MCP — wraps OpenStreetMap Nominatim geocoding API (free, no auth)
OpenStreetMap Overpass MCP — programmatic queries against the OSM database
Geoapify MCP — wraps the Geoapify Location Platform (geoapify.com)
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/cyanheads/openstreetmap-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server