
Nominatim Mcp Server
io.github.cyanheads由 GitHub 帳號 cyanheads 發布v0.1.8更新於 Nov 2, 2026
Geocode, reverse geocode, and run Overpass spatial queries on OpenStreetMap data.
概覽
OpenStreetMap 地理編碼與空間查詢伺服器:把地名轉成座標、把座標轉成地址,並依標籤查找 OSM 地物。
- 可以做什麼
- 搜尋地名與地址,回傳座標、結構化地址和 OSM 識別碼
- 將經緯度反查為最接近的地址或地點名稱
- 依 ID 查詢已知 OSM 物件的地址紀錄
- 依標籤在半徑、邊界框或城市、公園等 OSM 邊界內尋找地物
- 執行原始 Overpass QL 查詢,補足其他工具無法表達的需求
- 適用情境
- 適合需要真實地理位置資料的情境:把地址解析成座標、描述地圖上某個點,或依標籤列出附近的設施、商家與地物。也適用於需要翻頁瀏覽 OSM 結果或自訂 Overpass 查詢的地圖研究。
- 執行需求
- 可使用託管的 HTTP 端點,或以 npx 在本機執行(從原始碼建置需 Bun 1.4+ 或 Node.js 24+)。不需要 API 金鑰。需要連外網路存取 Nominatim 與 Overpass;上游使用政策要求設定 OSM_USER_AGENT,並可用 OSM_NOMINATIM_BASE_URL 與 OSM_OVERPASS_BASE_URL 指向鏡像或自架實例。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Nominatim Mcp Server,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Web executable,透過 Streamable HTTP。 遠端服務在工作區中設定後即可從網頁執行環境執行。
交給代理程式安裝
把這段提示詞貼上到 Claude Code、Codex、Cursor 等代理程式,或 SourceWeft 對話中。代理程式會讀取該伺服器的安裝指南,先向你展示發布者、端點和登入方式,經你同意後再把它新增到你的客戶端。金鑰不會寫進任何命令。
閱讀 https://sourceweft.com/mcp/io.github.cyanheads%2Fnominatim-mcp-server/install.md,並按其中說明把這個 MCP 伺服器接入我的客戶端。修改任何設定之前,先告訴我它的發布者、端點和登入方式,等我確認。不要把 API 金鑰寫進命令或我會提交的檔案;問我金鑰應從哪裡取得。其他 MCP 客戶端
把它新增到你客戶端的 mcpServers 設定中。
{
"mcpServers": {
"nominatim": {
"type": "http",
"url": "https://nominatim.caseyjhand.com/mcp"
}
}
}README
@cyanheads/openstreetmap-mcp-server
Geocode, reverse geocode, and run Overpass spatial queries on OpenStreetMap data via MCP. STDIO or Streamable HTTP.
Public Hosted Server: https://openstreetmap.caseyjhand.com/mcp
Overview
OpenStreetMap data through Nominatim and the Overpass API. Geocode places and addresses, resolve coordinates to the nearest address, look up known OSM objects, and query features by tag around a point, inside a bounding box, or inside an OSM boundary.
Tools
Capability reference
The openstreetmap-guide skill covers place resolution, spatial queries, paging, and interpreting coverage and tag results.
Argument aliases are accepted before canonical validation: latitude / longitude for lat / lon on nearby and reverse queries, radius_m for nearby's radius_meters, and q for search's query. Send either spelling, never both. radius, tag, and tags remain invalid; advertised schemas use canonical names.
openstreetmap_search_places tool
- Free-form
queryor the structured fieldsstreet,city,county,state,country,postalcode, never both; up to 40 results (limit, default 5; a largerlimitis served as 40 with alimitNotice), narrowed bycountrycodes,layer,featureType, and aviewbox(restricting withbounded: true) - Results carry coordinates, structured
address,boundingbox,importance, andosm_type+osm_id;extratagsadds contact and physical-attribute tags; an empty first page fails asno_results - A full page returns
nextExcludeIdsto pass back asexclude_place_ids; once results run out you get zero results and a notice, not an error
openstreetmap_reverse_geocode tool
lat/lonpluszoomfrom 3 (country) to 18 (building, the default);layerdefaults toaddress,poi- Returns the nearest indexed object with structured
address,osm_type+osm_id, andboundingbox; coordinates with no OSM data fail asno_coverage
openstreetmap_lookup_objects tool
- Up to 500
osm_idsentries, each prefixedN,W, orR(["N240109189"]); a malformed ID fails asinvalid_id_format - The first 50 unique IDs are looked up; the rest come back as
deferred_idsfor the next call - Returns address records for the objects found and lists the rest under
not_found(including objects Nominatim does not index, such as street lamps); anoticecarries anopenstreetmap_query_rawquery to check which exist
openstreetmap_query_nearby tool
lat/lonwithradius_metersup to 50,000 (default 1,000); one primary tag,amenityortag_keywith an optionaltag_value, plus up to five ANDedfilters; up to 500 features per page (a largerlimitis served as 500 with alimitNotice)- A value matches exactly by default;
list_itemmode (tag_value_match, ormatchon a filter) matches one item of a semicolon list, socuisine=pizzaalso findscuisine=pizza;italian - An
amenityvalue that OpenStreetMap tags under another key (amenity: "museum"; museums aretourism=museum) gets anoticenaming the key to retry with - Features carry
osm_type+osm_id, coordinates,distance_meters(to the feature's nearest point), and the full tag set, sorted nearest-first;effectiveTagechoes the filter chain
openstreetmap_query_bbox tool
- One scope per call: the corners
south,west,north,east, orwithinand oneR/Wboundary ref (R237385) built from a geocoding result'sosm_type+osm_id; the same tag filters, list-item matching, stray-amenitynotice, and 500-per-page cap asopenstreetmap_query_nearby effectiveAreaechoes howwithinresolved andareasTimestamphow old the area data is; a ref that maps to no area returns an empty page with a notice- A
westgreater thaneastis a box crossing the antimeridian;southgreater thannorthfails asinvalid_bbox
openstreetmap_query_raw tool
- Any Overpass QL containing
[out:json];[timeout:N]comes fromtimeout_seconds(up to 180, default 30) and[maxsize:268435456](256 MiB) is added when the query sets none; up to 500 elements per page (a largerlimitis served as 500 with alimitNotice) - Returns raw elements (ways carry
nodes[], relationsmembers[]), plustotal_elementsand theeffectiveQueryas sent; malformed QL fails asquery_errorwith Overpass's parse error max_element_bytes(default 20,000, minimum 1,000) withholds an over-budget element'smembers,nodes, orgeometryarrays, listed underwithheld_keys;withheldElementsandwithheldNoticesay how to fetch them
Features
Built on @cyanheads/mcp-ts-core: stdio and Streamable HTTP transports, pluggable auth (none / jwt / oauth), swappable storage (in-memory, filesystem, Supabase, Cloudflare KV/R2/D1), structured logging with optional OpenTelemetry tracing.
OpenStreetMap-specific:
- Nominatim requests are spaced 1,050 ms apart to respect its one-request-per-second policy;
OSM_USER_AGENTidentifies the server to both upstreams - Overpass queries are limited per endpoint by
OSM_OVERPASS_MAX_CONCURRENCY, with opt-in failover acrossOSM_OVERPASS_ENDPOINTS(see Overpass endpoint failover) - Overpass tools page with
limitandoffsetand reporttotalFound,truncated, andnextOffset; results are cached for 10 minutes (Nominatim for 60), so re-paging makes no new upstream request - An Overpass response over 64 MiB fails as
result_too_large OSM_NOMINATIM_BASE_URLandOSM_OVERPASS_BASE_URLpoint the server at a self-hosted or mirror instance
Agent-friendly output:
effectiveQuery,effectiveTag, andeffectiveAreaecho what was sent; Overpass responses adddata_timestampandservingEndpoint, and every response carries the ODbLattributionosm_type+osm_idfrom any tool feedopenstreetmap_lookup_objects, and a geocoded relation or way becomes awithinref foropenstreetmap_query_bbox- The Nominatim tools never select by tag, and
tagSelectionCaveatsays so; regex, alternation, and negation go throughopenstreetmap_query_raw - Names and tag values are escaped in the Markdown output;
structuredContentkeeps the raw text
Getting started
Connect to the hosted instance, no install:
Or run it locally:
For other clients, add this to the MCP config file:
No API key is required. For heavy use, point OSM_NOMINATIM_BASE_URL and OSM_OVERPASS_BASE_URL at your own instances. For Docker or a source build, see Running the server.
Configuration
See .env.example for the full list of optional overrides. An invalid value for any OSM_* variable stops the server at startup with a message naming the variable.
Overpass endpoint failover
By default every Overpass query goes to one endpoint, the FOSSGIS-operated main instance. List more in OSM_OVERPASS_ENDPOINTS and a failed call moves to the next entry in order:
- Endpoints that fail repeatedly are skipped for a while (30 seconds, doubling up to 10 minutes)
- When every endpoint fails, the call fails with
rate_limited,upstream_error,overpass_unavailable,endpoints_rejected,endpoints_exhausted, orendpoints_unavailable, with each endpoint's outcome in the message - Endpoints are reported by origin only (
https://overpass-api.de) inservingEndpoint, error messages, and logs - Extra entries are failover only and never add concurrency. For an instance that allows parallel queries, append
|Nto its entry (https://mirror.example/api/interpreter|4) for N slots; write a literal|in a URL as%7C. Never size a public FOSSGIS server - Calls waiting for a slot fail with
pacer_shedand aretryAfterof at least 30 seconds after 30 seconds in line
Adding an endpoint sends your queries to a third party. Check its usage policy on the OSM wiki instance list, confirm it holds global data (a regional instance answers out-of-extract queries with an empty HTTP 200), and expect mirrors to lag the main instance; servingEndpoint and data_timestamp show which host answered and how fresh its data was.
Running the server
Local development
Requires Bun v1.4.0 or higher (or Node.js v24+).
-
Build and run the production version:
-
Run checks and tests:
Docker
The image serves HTTP at http://localhost:3010/mcp in stateless session mode and logs to /var/log/openstreetmap-mcp-server. OpenTelemetry peer dependencies are installed by default; build with --build-arg OTEL_ENABLED=false to omit them. Runtime telemetry stays off until you pass -e OTEL_ENABLED=true.
Project structure
Development guide
See CLAUDE.md for development guidelines and architectural rules. The short version:
- Handlers throw, framework catches — no
try/catchin tool logic - Use
ctx.logfor logging,ctx.statefor storage - Register new tools in the
createApp()arrays insrc/index.ts - Wrap external API calls: validate raw → normalize to domain type → return output schema; never fabricate missing fields
Contributing
Issues are welcome. Run checks and tests before submitting:
License
Apache-2.0 — see LICENSE for details.
Map data from OpenStreetMap contributors, available under the Open Database License (ODbL).
來源:README.md,提交 567a2ab
工具
0版本歷史
1- v0.1.8最新Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通必需25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式必需10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分