osm-mcp
osm-mcp
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サービスへのインターネットアクセス(下記の表を参照)
設定
すべての変数はオプションです。サーバーはそのまま動作します。
変数 | デフォルト | 説明 |
|
| すべてのサービスに送信されるUser-Agent。Nominatimは実際の識別可能なものを要求します。 |
|
| ジオコーディング / 逆ジオコーディング |
|
| タイポ耐性ジオコーディング |
|
| ルーティング、行列、トリップ最適化。 |
|
| カンマ区切りのOverpassエンドポイント。429/5xx時に順に試行されます。 |
|
| 等時線 |
| – | オプションのOpenRouteServiceキー(シークレット)。設定すると、ルート、行列、等時線にOSRM/Valhallaの代わりにORSを使用します。無料枠: 2000方向/日、40/分。 |
|
| OpenRouteServiceエンドポイント |
|
| 同一のアップストリームレスポンスをメモリキャッシュから提供する秒数( |
インストール
claude mcp add osm -- npx -y osm-mcpClaude 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 は必須です。プロトコルは標準入力と標準出力で動作します。公開するポートはありません。その他のクライアント設定方法はクライアントガイドにあります。
ツール
ツール | 説明 |
| 場所名/住所 → 座標(NominatimまたはPhoton) |
| 座標 → 最寄りの住所 |
| 2つ以上のウェイポイント間の距離と所要時間、 |
| 1回の呼び出しですべての出発地からすべての目的地までの移動時間/距離 |
| 一連の停留所の最適な訪問順序(巡回セールスマン問題、OSRM trip) |
| 時間または距離の予算内で到達可能なエリア(Valhalla、またはキーを使用してORS) |
| カテゴリまたは生のOSMタグによる場所周辺のPOI、距離順にソート(Overpass) |
| 1つの要素の完全なOSMレコード: 営業時間、ウェブサイト、電話番号など |
| 2~8人に適した公平な待ち合わせ場所(移動時間のバランス) |
| 大圏距離、オフラインで計算 |
| 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リリース
タグ駆動型で、手動の公開手順は不要です。
CHANGELOG.mdの[Unreleased]エントリを新しい## [x.y.z] - YYYY-MM-DDセクションに移動し、package.jsonのバージョンを更新します。npm run lint && npm run build && npm run test:coverageを実行します。コミット後、署名付き注釈付きタグを作成します:
git tag -s vx.y.z -m "vx.y.z"。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 ワークフローを手動で起動してください。タグジョブを再実行しないでください。古いツリーをチェックアウトすることになります。
ライセンス
Available Tools
11 toolsfind_nearby_poisFind nearby places (POIs)ARead-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 addressARead-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)ARead-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
map_linkGenerate map linksARead-onlyIdempotent
Generates openstreetmap.org links to open in a browser: a marker link for a single place, or a directions link when from and to are given. Provide either "place", or both "from" and "to".
Inputs: to, from, place, profile, +1 more. Returns: to, from, place, marker, +4 more
optimize_routeOptimize stop orderARead-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 detailsARead-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 coordinatesARead-onlyIdempotent
Converts coordinates into the nearest address or place name (Nominatim).
Inputs: latitude (required), longitude (required), language. Returns: note, result, source, untrusted
routeRoute between placesARead-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 matrixARead-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 distanceARead-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 pointARead-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
Scored across 11 tools
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.
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.
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.
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
Related MCP Connectors
Geocoding, routing, isochrones, traffic, weather, and place search for AI agents. 19 MCP tools.
Maps, geocoding and time zones for AI coding agents, on OpenStreetMap, with hard prepaid spend caps.
Hosted MCP for live place search, geocoding & turn-by-turn routes. No Maps API key to manage.
Geocoding, static maps and privacy-safe area maps from OpenStreetMap data. Hard caps, no overage.
Related MCP Servers
- AlicenseBqualityDmaintenanceA 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.306MIT
- AlicenseNot gradedqualityCmaintenanceFree 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
- FlicenseNot gradedqualityBmaintenanceAn MCP server providing geocoding, routing, isochrones, and POI-by-proximity search through self-hosted OpenStreetMap backends.-
- AlicenseNot gradedqualityCmaintenanceMCP server for geocoding, reverse geocoding, place/POI search, and distance calculation using OpenStreetMap Nominatim, with no API key required.89 npm1MIT