home / mcp / mapbox mcp server

Mapbox MCP Server

Provides MCP endpoints for Mapbox navigation, geocoding, and matrix calculations to power routing and place lookups.

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "aidenyangx-mapbox-mcp-server": {
      "command": "node",
      "args": [
        "/absolute/path/to/mapbox-mcp-server/build/index.js"
      ],
      "env": {
        "MAPBOX_ACCESS_TOKEN": "YOUR_API_KEY"
      }
    }
  }
}

You run a Mapbox MCP Server that exposes a set of tools to interact with Mapbox services—directions, matrix calculations, and geocoding. This server lets you perform navigation, distance/time computations, and place lookups programmatically through a consistent MCP interface.

How to use

You can access the Mapbox MCP Server tools through your MCP client to perform common Mapbox operations. The available tools cover directions between coordinates, directions between places by name, travel time and distance matrices, and geocoding for forward lookups. Use these tools to build routing features, route previews, trip planning, and location search into your applications.

How to install

Prerequisites to run the Mapbox MCP Server are: Node.js 16 or higher, TypeScript 4.5 or higher, and a valid Mapbox API key.

Set up your environment with your Mapbox API key as an environment variable.

Install and run the MCP server using the following steps. Copy each command exactly as shown.

Install dependencies and build the server (adjust according to your project setup if needed).

npm install
npm run build

Start the server with the required environment variable for your Mapbox access token. Use the final runtime command shown in the configuration snippet.

MAPBOX_ACCESS_TOKEN=your_api_key_here npm start

If you are integrating with Claude Desktop, you can configure the MCP server as shown in the example below. This starts a local server process via Node and points to the built entry, with the API key provided as an environment variable.

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

Additional notes

The Mapbox MCP Server exposes the following tools and endpoints for practical usage. Each tool is designed to be invoked via your MCP client to return results such as routes, matrices, and geocoding data.

Tool overview

- mapbox_directions: Get directions between coordinates with an optional profile like driving-traffic, driving, walking, or cycling.

- mapbox_directions_by_places: Get directions between named places, returning geocoding results and route details.

- mapbox_matrix: Compute travel time and distance matrices between coordinates with optional annotations and subset selection.

- mapbox_matrix_by_places: Compute matrices between named places with optional language and subsets.

- mapbox_geocoding: Search for places and addresses, returning coordinates and place properties.

Security and rate limits

Respect Mapbox rate limits per API: Directions up to 300 requests per minute, Matrix up to 60 (or 30 for driving-traffic), Geocoding up to 600 per minute. Protect your API key and rotate credentials as needed.

Error handling

The server implements validation of inputs, handles API request failures, rate limit errors, and service-specific errors such as missing routes or invalid coordinates. Your client should gracefully handle these errors and implement retry/backoff as appropriate.

Available tools

mapbox_directions

Get directions between coordinates with an optional profile: driving-traffic, driving, walking, or cycling. Returns route details including steps, distance, and duration.

mapbox_directions_by_places

Get directions between named places. Returns geocoding results for each place, route details with steps, distance, duration, and any errors.

mapbox_matrix

Compute travel time and distance matrices between coordinates with optional profiles and annotations. Returns a matrix of durations and/or distances.

mapbox_matrix_by_places

Compute travel time and distance matrices between named places with optional language, sources, and destinations. Returns geocoding results and a matrix of durations and/or distances.

mapbox_geocoding

Search for places and convert addresses into coordinates. Returns detailed location information including coordinates and properties.