Skip to main content
Glama

osm-mcp

CI npm version npm downloads node Container license Docs

OpenStreetMap向けのMCPサーバーです。ジオコーディング、徒歩・車・自転車の距離と所要時間、複数経由地のルート最適化、等時線、POI検索を提供し、AIアシスタントによる旅行計画のために構築されています。

11のツールを提供し、すべて読み取り専用です。すべてのバックエンドは無料の公開OpenStreetMapサービスであり、APIキーは不要です。オプションでOpenRouteServiceのキーを指定すると、ルーティングエンジンを切り替えることができます。

📖 完全なドキュメント: https://osm-mcp.ni-c.de

なぜ別のOSM MCPサーバーなのか?

  • 正しい徒歩・自転車ルート。 公開OSRMデモサーバーはOSRM URLパス内のプロファイルセグメントを無視し、FOSSGISの routed-foot / routed-bike / routed-car パスプレフィックスが使用されない限り、常に車のルートを返します。既存のほとんどのOSM MCPサーバーはこれを誤って処理し、徒歩クエリに対して黙って車の所要時間を返します。このサーバーは正しいプレフィックスを使用し、ライブスモークテストで徒歩ルートが車ルートよりもはるかに遅いことを確認しています。

  • ポリシー準拠の設計。 サービスごとのレート制限(NominatimとOSRM: 1リクエスト/秒)、すべてのリクエストに識別用のUser-Agent(Nominatim利用ポリシーで必須)、レスポンスキャッシュ、Overpassの同時実行数制限(2スロット)、429/5xxエラー時のOverpassミラーへの自動フェイルオーバーを備えています。

  • Photonサポート。 komootのPhotonによるオプションのタイポ耐性ジオコーディング。インタラクティブな使用向けに設計されており、Nominatimを連打するよりもLLM駆動のルックアップに適しています。

Related MCP server: Geo MCP Worker

要件

  • Node.js ≥ 22

  • 公開OpenStreetMapサービスへのインターネットアクセス(下記の表を参照)

設定

すべての変数はオプションです。サーバーはそのまま動作します。

変数

デフォルト

説明

OSM_USER_AGENT

osm-mcp/<version> (+https://github.com/ni-c/osm-mcp)

すべてのサービスに送信されるUser-Agent。Nominatimは実際の識別可能なものを要求します。

NOMINATIM_BASE_URL

https://nominatim.openstreetmap.org

ジオコーディング / 逆ジオコーディング

PHOTON_BASE_URL

https://photon.komoot.io

タイポ耐性ジオコーディング

OSRM_BASE_URL

https://routing.openstreetmap.de

ルーティング、行列、トリップ最適化。routed-{car,bike,foot} パスプレフィックス(FOSSGISレイアウト)を提供する必要があります。

OVERPASS_BASE_URL

https://overpass-api.de/api/interpreter,https://overpass.private.coffee/api/interpreter

カンマ区切りのOverpassエンドポイント。429/5xx時に順に試行されます。

VALHALLA_BASE_URL

https://valhalla1.openstreetmap.de

等時線

ORS_API_KEY

–

オプションのOpenRouteServiceキー(シークレット)。設定すると、ルート、行列、等時線にOSRM/Valhallaの代わりにORSを使用します。無料枠: 2000方向/日、40/分。

ORS_BASE_URL

https://api.openrouteservice.org

OpenRouteServiceエンドポイント

OSM_CACHE_TTL

3600

同一のアップストリームレスポンスをメモリキャッシュから提供する秒数(0でキャッシュ無効化)

インストール

claude mcp add osm -- npx -y osm-mcp

Claude Desktop (claude_desktop_config.json):

{
  "mcpServers": {
    "osm": {
      "command": "npx",
      "args": ["-y", "osm-mcp"]
    }
  }
}

Codex (~/.codex/config.toml):

[mcp_servers.osm]
command = "npx"
args = ["-y", "osm-mcp"]

コンテナ(マルチアーキテクチャ、SBOMとビルド証明書付き):

docker run -i --rm ghcr.io/ni-c/osm-mcp

-i は必須です。プロトコルは標準入力と標準出力で動作します。公開するポートはありません。その他のクライアント設定方法はクライアントガイドにあります。

ツール

ツール

説明

geocode

場所名/住所 → 座標(NominatimまたはPhoton)

reverse_geocode

座標 → 最寄りの住所

route

2つ以上のウェイポイント間の距離と所要時間、foot/car/bike。オプションで区間ごとの要約

route_matrix

1回の呼び出しですべての出発地からすべての目的地までの移動時間/距離

optimize_route

一連の停留所の最適な訪問順序(巡回セールスマン問題、OSRM trip)

isochrone

時間または距離の予算内で到達可能なエリア(Valhalla、またはキーを使用してORS)

find_nearby_pois

カテゴリまたは生のOSMタグによる場所周辺のPOI、距離順にソート(Overpass)

poi_details

1つの要素の完全なOSMレコード: 営業時間、ウェブサイト、電話番号など

suggest_meeting_point

2~8人に適した公平な待ち合わせ場所(移動時間のバランス)

straight_line_distance

大圏距離、オフラインで計算

map_link

openstreetmap.orgのマーカー/ルート案内リンク、オフラインで計算

すべての場所入力は、名前/住所(自動ジオコーディング)またはリテラル座標 "lat,lon" のいずれかを受け付けます。

利用ポリシーと帰属表示

このサーバーは共有コミュニティインフラと通信します。公開されている制限をクライアント側で強制しますが、運営者は全体的な使用を軽度かつ非商業的に抑えるようユーザーに求めています。

  • データ: © OpenStreetMap コントリビューター、ODbL 1.0 に基づきライセンス。

  • Nominatim: 最大1リクエスト/秒、識別用User-Agent必須、結果はキャッシュされます(ポリシー)。

  • OSRM / Valhalla (FOSSGIS): 妥当かつ非商業的な使用。最大1リクエスト/秒(詳細)。

  • Overpass: IPあたり約2同時スロット、10,000クエリ/日未満(wiki)。

  • Photon: フェアユース(photon.komoot.io)。

大量または商業的な使用の場合は、サービスをセルフホストし、*_BASE_URL 変数で自身のインスタンスを指定してください。

安全性

  • すべてのツールは読み取り専用です。サーバーがOpenStreetMapに書き込むことはありません。

  • 認証情報は不要です。オプションの ORS_API_KEY は読み込み後にプロセス環境から削除され、エラーメッセージからも編集されます。

  • OSM由来のコンテンツ(名前、住所、タグ)はツール結果内で信頼できないデータとしてマークされ、モデルがデータとして扱い、指示として扱わないようにします。

  • アップストリームのエラー本文は切り詰められ、HTMLエラーページはモデルコンテキストに到達する前に削除されます。

  • リダイレクトは決して追跡されません。すべてのリクエストはタイムアウトします。

開発

npm install
npm run lint          # eslint + prettier
npm test              # unit tests (all upstream APIs mocked)
npm run test:coverage
npm run build
npm run smoke         # opt-in LIVE test against the real public services

リリース

タグ駆動型で、手動の公開手順は不要です。

  1. CHANGELOG.md の [Unreleased] エントリを新しい ## [x.y.z] - YYYY-MM-DD セクションに移動し、package.json のバージョンを更新します。

  2. npm run lint && npm run build && npm run test:coverage を実行します。

  3. コミット後、署名付き注釈付きタグを作成します: git tag -s vx.y.z -m "vx.y.z"。

  4. git push origin main vx.y.z を実行します。

その後、release.yml がテストを実行し、Trusted Publishing(トークンシークレット不要)を介してnpmに公開し、CHANGELOGセクションからGitHubリリースを作成し、MCPレジストリに io.github.ni-c/osm-mcp として公開します。ci.yml は同じタグでマルチアーキテクチャイメージをGHCRにプッシュします。

レジストリのステップが失敗した場合は、main ブランチで修正し、Publish to MCP Registry ワークフローを手動で起動してください。タグジョブを再実行しないでください。古いツリーをチェックアウトすることになります。

ライセンス

MIT

Available Tools

11 tools
find_nearby_poisFind nearby places (POIs)A
Read-onlyIdempotent

Finds points of interest near a location, sorted by distance. Category shortcuts: restaurant, cafe, bar, pub, fast_food, ice_cream, hotel, hostel, guest_house, apartment, camp_site, attraction, museum, gallery, viewpoint, information, artwork, castle, monument, ruins, supermarket, bakery, convenience, pharmacy, hospital, doctors, police, atm, bank, fuel, charging_station, parking, toilets, drinking_water, bus_stop, train_station, tram_stop, ferry_terminal, bicycle_rental, car_rental, playground, park, beach, swimming_pool. Any other OSM tag works as "key" or "key=value" (e.g. "diet:vegan=yes"). Use poi_details for the full record of one result.

Inputs: near (required), category (required), limit, language, +1 more. Returns: near, note, count, source, +3 more

geocodeGeocode a place or addressA
Read-onlyIdempotent

Converts a place name or address into coordinates using OpenStreetMap. Returns matching places with lat/lon, a display label and the OSM id. Provider "nominatim" (default) is best for addresses; "photon" is typo-tolerant and better for fuzzy place names.

Inputs: query (required), limit, language, provider, +1 more. Returns: note, source, results, provider, +1 more

isochroneReachable area (isochrone)A
Read-onlyIdempotent

Shows how far you can get from a place within a time or distance budget ("what is reachable in 15 minutes on foot?"). Returns a compact summary of the reachable area: bounding box and reach per compass direction. Give exactly one of minutes or kilometers.

Inputs: center (required), profile (required), minutes, language, +1 more. Returns: reach, budget, center, engine, +4 more

optimize_routeOptimize stop orderA
Read-onlyIdempotent

Finds the best order to visit a set of stops (traveling-salesman optimization) and returns the optimized itinerary with total distance and time. With roundtrip (default) the tour returns to the first stop; without it the first stop is the start and the last stop the end.

Inputs: stops (required), profile (required), language, roundtrip. Returns: legs, engine, source, profile, +4 more

poi_detailsGet POI detailsA
Read-onlyIdempotent

Fetches the full OpenStreetMap record of one element — all tags (opening hours, website, phone, …), coordinates and a map link. Takes an OSM id as returned by find_nearby_pois or geocode, e.g. "node/240109189".

Inputs: osm_id (required). Returns: lat, lon, map, osm, +4 more

reverse_geocodeReverse geocode coordinatesA
Read-onlyIdempotent

Converts coordinates into the nearest address or place name (Nominatim).

Inputs: latitude (required), longitude (required), language. Returns: note, result, source, untrusted

routeRoute between placesA
Read-onlyIdempotent

Calculates the real-world travel distance and time between two or more places, walking, driving or cycling, on OpenStreetMap data. Waypoints are visited in the given order. Set include_steps for a turn-by-turn summary. Use route_matrix to compare many pairs, optimize_route to reorder stops.

Inputs: profile (required), waypoints (required), language, include_steps. Returns: legs, steps, engine, source, +8 more

route_matrixTravel time/distance matrixA
Read-onlyIdempotent

Computes travel times and distances from every origin to every destination in one call — ideal for comparing options (e.g. 5 hotels against 3 sights). Cells are null where no route exists.

Inputs: origins (required), profile (required), destinations (required), language. Returns: engine, source, origins, profile, +4 more

straight_line_distanceStraight-line distanceA
Read-onlyIdempotent

Great-circle ("as the crow flies") distance between two places. Instant and independent of any road network — use route for real travel distances.

Inputs: to (required), from (required), language. Returns: to, from, source, distance, +2 more

suggest_meeting_pointSuggest a meeting pointA
Read-onlyIdempotent

Suggests a fair place to meet for people starting from different locations: finds venues around the geographic midpoint and picks the one with the most balanced travel times for everyone.

Inputs: locations (required), profile, language, venue_category, +1 more. Returns: note, source, profile, midpoint, +4 more

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.3/5.0

    Scored across 11 tools

    Disambiguation5/5

    Each tool has a clearly distinct purpose: geocode/reverse_geocode handle place-coordinate conversion, route/route_matrix/optimize_route are tightly differentiated by use case, and find_nearby_pois/poi_details form a clear list-to-detail flow. The routing tools could feel similar at first glance, but their descriptions explicitly disambiguate single ordered routes, many-to-many matrices, and stop reordering.

    Naming Consistency4/5

    Most multi-word names use a predictable snake_case style: reverse_geocode, route_matrix, find_nearby_pois, straight_line_distance. The set does mix verb-led names like find_nearby_pois and optimize_route with noun-led names like isochrone, poi_details, and map_link, but the overall pattern is still clear and readable.

    Tool Count5/5

    With 11 tools, the server is well within the ideal range and each tool earns its place by covering a distinct geospatial capability. None of the tools feel redundant, and the count is appropriate for a domain spanning geocoding, routing, POI search, and map links.

    Completeness5/5

    The tool set covers the full common workflow for an OSM-based location server: forward and reverse geocoding, routes, matrices, route optimization, isochrones, POI discovery and details, meeting-point suggestions, straight-line distance, and shareable map links. Results from earlier tools feed naturally into later tools, such as POI ids into poi_details and places into route or map_link, leaving no obvious dead ends.

    Maintenance

    ActivityNo data
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      D
      maintenance
      A comprehensive MCP server providing 30 tools for geocoding, routing, and OpenStreetMap data analysis. It enables AI assistants to search for locations, calculate travel routes, and perform quality assurance checks on map data.
      30
      6
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Free geospatial MCP server for AI agents, providing geocoding, reverse geocoding, POI search, and route planning using OpenStreetMap data via Nominatim, Overpass, and OSRM.
      GPL 3.0
    • A
      license
      Not graded
      quality
      C
      maintenance
      MCP server for geocoding, reverse geocoding, place/POI search, and distance calculation using OpenStreetMap Nominatim, with no API key required.
      89 npm
      1
      MIT