Skip to main content
Glama

Mapbox MCP サーバー

Mapbox API 用の MCP サーバー。

特徴

ナビゲーションツール

  1. mapbox_directions

    • 座標間の道順を取得する

    • 入力:

      • coordinates ({緯度: 数値, 経度: 数値}[])

      • profile (オプション): 「運転中の交通」、「運転」、「歩行」、「サイクリング」

    • 返される値: 歩数、距離、所要時間を含むルートの詳細

  2. mapbox_directions_by_places

    • 場所の名前を使って場所間の道順を取得します

    • 入力:

      • places (string[]): 地名の配列

      • profile (オプション): 「運転中の交通」、「運転」、「歩行」、「サイクリング」

      • language (オプション): 2文字の言語コード(例:「zh」、「en」)

    • 戻り値:

      • 各場所のジオコーディング結果

      • 歩数、距離、所要時間を含むルートの詳細

      • 処理中に発生したエラー

  3. mapbox_matrix

    • 座標間の移動時間と距離行列を計算する

    • 入力:

      • coordinates ({緯度: 数値, 経度: 数値}[])

      • profile (オプション):「運転」、「徒歩」、「サイクリング」

      • annotations (オプション): 「duration」、「distance」、「duration,distance」

      • sources (オプション): ソース座標のインデックス

      • destinations (オプション): 目的地の座標のインデックス

    • 戻り値: 点間の期間および/または距離の行列

  4. mapbox_matrix_by_places

    • 場所の名前を使用して、場所間の移動時間と距離のマトリックスを計算します

    • 入力:

      • places (string[]): 地名の配列(2~25か所)

      • profile (オプション):「運転」、「徒歩」、「サイクリング」

      • annotations (オプション): 「duration」、「distance」、「duration,distance」

      • language (オプション): 2文字の言語コード

      • sources (オプション): ソースの場所のインデックス

      • destinations (オプション): 目的地のインデックス

    • 戻り値:

      • 各場所のジオコーディング結果

      • 期間および/または距離のマトリックス

      • 処理中に発生したエラー

検索ツール

  1. mapbox_geocoding

    • 場所を検索し、住所を座標に変換する

    • 入力:

      • searchText (文字列): 検索する場所または住所

      • limit (オプション): 結果の最大数 (1-10)

      • types (オプション):場所の種類(国、地域、場所など)でフィルタリングします。

      • language (オプション): 2文字の言語コード

      • fuzzyMatch (オプション): あいまい一致を有効/無効にする

    • 戻り値: 座標やプロパティを含む詳細な位置情報

Related MCP server: Overture Maps MCP

クロードデスクトップ統合

この構成を Claude Desktop 構成ファイル (通常は~/Library/Application Support/Claude/claude_desktop_config.jsonにあります) に追加します。

{
  "mcpServers": {
    "mapbox-mcp-server": {
      "command": "node",
      "args": ["/absolute/path/to/mapbox-mcp-server/build/index.js"],
      "env": {
        "MAPBOX_ACCESS_TOKEN": "your-api-key"
      }
    }
  }
}

設定

前提条件

  • Node.js 16以上

  • TypeScript 4.5以上

  • 有効なMapbox APIキー

APIキー

ここの指示に従って Mapbox API キーを取得します。

API キーを環境変数として設定します。

export MAPBOX_ACCESS_TOKEN=your_api_key_here

レート制限

  • Directions API: 1 分あたり 300 リクエスト

  • マトリックスAPI:

    • 運転/歩行/自転車で1分あたり60件のリクエスト

    • 運転中の交通量に対する1分あたり30件のリクエスト

  • ジオコーディング API: 1 分あたり 600 リクエスト

展開

構造

mapbox-mcp-server では、次の構造を使用してサーバーのハンドラーを管理します。

  • src/server/handlers/base.ts : すべてのハンドラーの基本クラス

  • src/server/registry.ts : すべてのハンドラーのレジストリ

  • src/server/main.ts : サーバーのメインエントリポイント

各機能モジュールは次の構造に従います。

src/
├── types/          # Type definitions
├── schemas/        # Zod schemas for validation
├── tools/
│   ├── definitions/  # Tool definitions
│   └── handlers/     # Tool implementations
└── server/
    └── handlers/     # Handler classes

クラス図:mapbox-mcp-server クラス図


プロセス図:mapbox-mcp-server-プロセス図

エラー処理

すべてのツールは包括的なエラー処理を実装しています。

  • 入力検証エラー

  • APIリクエストの失敗

  • レート制限エラー

  • サービス固有のエラー(例:ルートが見つからない、座標が無効)

ライセンス

このMCPサーバーはMITライセンスに基づいてライセンスされています。つまり、MITライセンスの条件に従って、ソフトウェアを自由に使用、改変、配布することができます。詳細については、プロジェクトリポジトリのLICENSEファイルをご覧ください。

Available Tools

5 tools
mapbox_directionsC

Get navigation route between two points

Inputs: coordinates (required), profile.

mapbox_directions_by_placesC

Get navigation route between multiple places using their names

Inputs: places (required), profile, language.

mapbox_geocodingC

Search for places and convert addresses into coordinates

Inputs: searchText (required), limit, types, language, +1 more.

mapbox_matrixC

Calculate travel time and distance matrices between coordinates

Inputs: coordinates (required), profile, annotations, approaches, +5 more.

mapbox_matrix_by_placesC

Calculate travel time and distance matrices between places using their names

Inputs: places (required), profile, annotations, language, +4 more.

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    B3.4/5.0

    Scored across 5 tools

    Disambiguation4/5

    The tools are mostly distinct, with clear purposes like routing, geocoding, and matrix calculations. However, the two directions tools (mapbox_directions and mapbox_directions_by_places) and two matrix tools (mapbox_matrix and mapbox_matrix_by_places) could cause minor confusion as they overlap in functionality but differ in input types (coordinates vs. place names). Descriptions help clarify this distinction.

    Naming Consistency5/5

    All tool names follow a consistent 'mapbox_' prefix with descriptive suffixes (e.g., directions, geocoding, matrix), using snake_case uniformly. The naming pattern is predictable and readable, making it easy for agents to understand the tool's purpose at a glance.

    Tool Count5/5

    With 5 tools, the server is well-scoped for its mapping and navigation domain. Each tool serves a distinct function (e.g., routing, geocoding, matrix calculations), and the count is neither too sparse nor overwhelming, fitting typical use cases effectively.

    Completeness4/5

    The tool set covers core mapping operations like routing, geocoding, and travel time calculations, with good coverage for the domain. A minor gap might be the lack of tools for additional Mapbox services (e.g., static maps or spatial analysis), but the provided tools enable key workflows without significant dead ends.

    Related MCP Connectors

    Related MCP Servers