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:
- Node.js LTS or later is required to build and run the MCP Server.
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.
Use the Mapbox MCP Server
The Mapbox MCP Server can be used in several ways:
- Option 1: Hosted Endpoint
- Option 2: Quick Start with npm
- Option 3: Local Deployment
Hosted Endpoint
For the simplest setup, you can connect directly to Mapbox's hosted MCP endpoint without installing or running anything locally. This endpoint is available at https://mcp.mapbox.com/mcp.
When you first connect, you will be prompted to complete an OAuth authentication flow through your browser before the MCP server becomes available. This hosted option eliminates the need for managing access tokens manually and is ideal for quick setup and testing.
Claude Desktop
Configure the hosted endpoint by adding the mcpServers key to your claude_desktop_config.json file:
{
"mcpServers": {
"mapbox-mcp": {
"command": "npx",
"args": ["mcp-remote", "https://mcp.mapbox.com/mcp"]
}
}
}
VS Code
Configure the hosted endpoint by adding the following to your VS Code user settings mcp.json file:
{
"servers": {
"mapbox-mcp": {
"type": "http",
"url": "https://mcp.mapbox.com/mcp"
}
}
}
Cursor
Configure the hosted endpoint by adding the following to your Cursor MCP configuration file (mcp.json):
{
"mcpServers": {
"mapbox-mcp": {
"type": "http",
"url": "https://mcp.mapbox.com/mcp"
}
}
}
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"
}
}
}
}
If you use a Node version manager like fnm or nvm 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 specify the full path to the node executable in the command field.
First, find your Node.js installation path by running this in your terminal (after activating your desired Node version):
On macOS/Linux:
which node
which npx
On Windows (PowerShell):
(Get-Command node).Path
(Get-Command npx).Path
On Windows (Command Prompt):
where node
where npx
Then use those paths in your configuration. For example:
{
"mcpServers": {
"MapboxServer": {
"command": "/Users/your-username/.local/state/fnm_multishells/12345_1234567890123/bin/node",
"args": ["/Users/your-username/.npm/_npx/1234567890/node_modules/.bin/npx", "-y", "@mapbox/mcp-server"],
"env": {
"MAPBOX_ACCESS_TOKEN": "YOUR_MAPBOX_ACCESS_TOKEN"
}
}
}
}
The exact paths will vary depending on your system and version manager. Use the output from which node and which npx to find your actual paths.
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.
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 will be located in the dist directory in two formats:
dist/esm/index.jsfor ESM (ECMAScript Module) supportdist/commonjs/index.jsfor CommonJS support
You will need to reference one of these locations when configuring consuming applications. Use the ESM version unless you have specific CommonJS requirements.
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/esm/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:
Configuration
The Mapbox MCP Server supports several configuration options to customize its behavior.
Environment Variables
-
MAPBOX_ACCESS_TOKEN(required): Your Mapbox access token for authenticating API requests. -
ENABLE_MCP_UI(optional): Toggle MCP-UI support for interactive features. Defaults to enabled. Set tofalseto disable. -
CLIENT_NEEDS_RESOURCE_FALLBACK(optional): Enable fallback tools for clients that don't support native MCP resources (like smolagents). Set totrueto enable. Defaults tofalse.
Command-Line Flags
When running the server locally, you can use the following command-line flags:
--disable-mcp-ui: Disable interactive UI rendering features.--enable-tools=<tool_names>: Activate only specified tools (comma-separated, case-sensitive). Example:--enable-tools=directions_tool,isochrone_tool--disable-tools=<tool_names>: Remove designated tools while keeping others active (comma-separated, case-sensitive). Example:--disable-tools=matrix_tool,optimization_tool
When both --enable-tools and --disable-tools are provided, the enable option takes precedence.
MCP-UI Support
The Mapbox MCP Server provides interactive UI capabilities for compatible clients through MCP-UI:
- Static Map Tool: Returns both image data and embeddable iframe URLs for interactive viewing
- Platform Support: Only Goose supports full interactive maps via MCP-UI. Other platforms (Claude Desktop, Visual Studio Code, Cursor) receive base64-encoded static images
- Progressive Enhancement: Tools function for all clients with enhanced UI only for capable clients
- Backward Compatible: Clients that don't support MCP-UI will still receive standard output
- Default Enabled: MCP-UI features are enabled by default with no configuration required
To disable MCP-UI features, set the ENABLE_MCP_UI environment variable to false or use the --disable-mcp-ui command-line flag.
Resources
The Mapbox MCP Server provides access to static reference data through MCP Resources. Clients can access these resources using the following URIs:
mapbox://categories- Default category list for POI searchesmapbox://categories/{language}- Localized category lists (e.g.,mapbox://categories/jafor Japanese,mapbox://categories/esfor Spanish)
These resources can be used to understand available POI categories and their localized names when constructing search queries.
Tools
The Mapbox MCP Server provides the following tools, which provide various geographic services such as searching for places, calculating routes, and generating maps. Tools are organized into categories based on their functionality.
Offline Geospatial Tools
These tools do calculations locally without making API calls, powered by Turf.js:
| Tool | Description |
|---|---|
distance | Calculate the distance between two geographic coordinates using the Haversine formula. |
point_in_polygon | Test if a point exists within polygon boundaries for geofencing applications. |
bearing | Determine compass direction between coordinates with cardinal directions. |
midpoint | Find the geographic center along the circle path between two points. |
| centroid | Calculate geometric center of polygons for marker placement. |
| area | Compute polygon areas in multiple units (acres, hectares, square miles, etc.). |
| bounding_box | Generate minimum bounding rectangles containing geometries. |
| buffer | Create proximity zones around points, lines, or polygons. |
| simplify | Reduce polygon vertices using Douglas-Peucker algorithm while preserving shape. |
Search & Navigation Tools
Tools for finding locations and converting between addresses and coordinates:
| Tool | Description |
|---|---|
resource_reader_tool | Accesses static reference data and category lists through MCP Resources (e.g., mapbox://categories). Useful for retrieving available POI categories and localized category names. |
search_and_geocode_tool | Uses the Search Box API to search for and geocode POIs, addresses, and places. |
category_search_tool | Searches for geographic categories such as countries, regions, or postal codes with proximity filtering. Powered by the Search Box API. |
poi_search_tool | Finds points of interest such as restaurants, gas stations, or landmarks near a given location. Powered by the Search Box API. |
forward_geocode_tool | Converts a place name or address into geographic coordinates. Powered by the Geocoding API – Forward Geocoding. |
reverse_geocode_tool | Converts geographic coordinates into a readable address or place name with customizable detail levels. Powered by the Geocoding API – Reverse Geocoding. |
Advanced Routing Tools
Tools for calculating routes, travel times, and accessibility:
| Tool | Description |
|---|---|
directions_tool | Calculates optimal routes between waypoints for driving (with traffic), walking, or cycling. Supports 2-25 waypoints with alternative routes. Powered by the Directions API. |
matrix_tool | Computes travel times and distances between multiple points. Ideal for optimizing logistics. Supports traffic-aware departures. Powered by the Matrix API. |
isochrone_tool | Calculates areas reachable within a specified travel time from a location. Powered by the Isochrone API. |
optimization_tool | Solves traveling sales rep problems for 2-12 locations to find optimal routes. Powered by the Optimization API. |
map_matching_tool | Snaps GPS traces to road networks with speed and congestion data. Powered by the Map Matching API. |
Visualization Tools
Tools for generating map images:
| Tool | Description |
|---|---|
static_map_image_tool | Generates customizable map images with markers, polylines, polygons, and style options. Powered by the Static Images API. |
Utility Tools
| Tool | Description |
|---|---|
version_tool | Returns server version information. |