Mapbox MCP Server
Current version:v0.1.0
- Get driving and walking directions
- Generate isochrones and static map images
- Look up addresses and points of interest
- Reverse geocode coordinates
The Mapbox MCP Server exposes Mapbox web services APIs in the Model Context Protocol, an open standard for AI tools to connect with external services. You can run the MCP Server locally or deploy it to a cloud service, and it can be used with any AI model that supports the Model Context Protocol.
Installation
Requirements:
- You will need a Mapbox Access Token to use the MCP Server.
- Node.js version 18 or later is required to build and run the MCP Server.
Use Mapbox MCP Server
The Mapbox MCP Server can be used in several ways:
- Option 1: Quick Start with npm
- Option 2: Local Deployment
Quick Start with npm
You must configure consuming applications to connect to the Mapbox MCP Server. This typically involves referencing the MCP Server’s NPM package via npx and setting your Mapbox Access Token as an environment variable.
For example, Claude Desktop users can configure MCP servers by adding the mcpServers
key to their claude_desktop_config.json
file:
{
"mcpServers": {
"MapboxServer": {
"command": "npx",
"args": [ "-y", "@mapbox/mcp-server"],
"env": {
"MAPBOX_ACCESS_TOKEN": "YOUR_MAPBOX_ACCESS_TOKEN"
}
}
}
}
Note: If you use NVM (Node Version Manager) to manage multiple versions of Node.js, Claude may not automatically resolve the correct version when launching the MCP Server via npx.
To make sure the server runs using the same Node.js version as npx, you should explicitly add the correct Node.js PATH
to the env
section of your claude_desktop_config.json
configuration.
For example, if your system uses Node.js v18.16.0 under NVM, add the following:
{
"mcpServers": {
"MapboxServer": {
"command": "npx",
"args": [ "-y", "@mapbox/mcp-server"],
"env": {
"MAPBOX_ACCESS_TOKEN": "YOUR_MAPBOX_ACCESS_TOKEN",
"PATH": "/Users/your-username/.nvm/versions/node/v18.16.0/bin:${PATH}"
}
}
}
}
Consult the documentation of your AI model or application for specific instructions on how to configure MCP servers.
Installation guides are available for the following applications in the public repository:
Local Deployment
To use Mapbox MCP Server with local Node.js involves two main steps:
- Clone the MCP Server code repository and build the project.
- Configure a consuming application to run and connect to the MCP Server, providing your Mapbox Access Token.
You will need a Mapbox Access Token to use the MCP Server. An access token associates your use of Mapbox Services with your account. If you don't have one, you can create a free account, then copy your access token from the Access Tokens page.
Clone and build the MCP Server
- Clone the repository:
$git clone https://github.com/mapbox/mcp-server.git
- Change into the project directory:
$cd mcp-server
- Install dependencies:
$npm install
- Build the project:
$npm run build
The built MCP Server is a node.js script that will be located at dist/index.js
in the project directory. You will need to reference this location when configuring consuming applications.
You may also build and run the MCP Server using Docker. See the Dockerfile
in the project repository.
Configure the consuming application
You must configure consuming applications to connect to the Mapbox MCP Server. This typically involves specifying the path to the MCP Server node.js file and providing your Mapbox Access Token as an environment variable.
For example, Claude Desktop users can configure MCP servers by adding the mcpServers
key to their claude_desktop_config.json
file:
{
"mcpServers": {
"MapboxServer": {
"command": "node",
"args": ["/Users/username/github-projects/mcp-server/dist/index.js"],
"env": {
"MAPBOX_ACCESS_TOKEN": "YOUR_MAPBOX_ACCESS_TOKEN"
}
}
}
}
Consult the documentation of your AI model or application for specific instructions on how to configure MCP servers.
Installation guides are available for the following applications in the public repository:
Tools
The Mapbox MCP Server provides the following tools, which provide various geographic services such as searching for places, calculating routes, and generating maps. Each tool is powered by a specific Mapbox Web Services API, and you can use them to enhance your AI-powered applications with geographic capabilities.
Tool | Description |
---|---|
CategorySearchTool | Searches for geographic categories such as countries, regions, or postal codes. Useful for narrowing down search queries to a specific type of place. Powered by the Search Box API |
DirectionsTool | Calculates optimal routes between waypoints for driving, walking, or cycling. Powered by the Directions API. |
ForwardGeocodeTool | Converts a place name or address into geographic coordinates. Powered by the Geocoding API – Forward Geocoding. |
IsochroneTool | Calculates areas reachable within a specified travel time from a location. Powered by the Isochrone API. |
MatrixTool | Computes travel times and distances between multiple points. Ideal for optimizing logistics. Powered by the Matrix API. |
POISearchTool | Finds points of interest such as restaurants, gas stations, or landmarks near a given location. Powered by the Search Box API. |
ReverseGeocodeTool | Converts geographic coordinates into a readable address or place name. Powered by the Geocoding API – Reverse Geocoding. |
StaticMapTool | Provides static map images of a specified location and zoom level with marker, circle, line, and polygon data overlays. Powered by the Static Images API. |