MCP Server for the Mapbox API.
mapbox_directions
coordinates
({latitude: number, longitude: number}[])profile
(optional): "driving-traffic", "driving", "walking", "cycling"mapbox_directions_by_places
places
(string[]): Array of place namesprofile
(optional): "driving-traffic", "driving", "walking", "cycling"language
(optional): Two-letter language code (e.g., "zh", "en")mapbox_matrix
coordinates
({latitude: number, longitude: number}[])profile
(optional): "driving", "walking", "cycling"annotations
(optional): "duration", "distance", "duration,distance"sources
(optional): Indices of source coordinatesdestinations
(optional): Indices of destination coordinatesmapbox_matrix_by_places
places
(string[]): Array of place names (2-25 places)profile
(optional): "driving", "walking", "cycling"annotations
(optional): "duration", "distance", "duration,distance"language
(optional): Two-letter language codesources
(optional): Indices of source placesdestinations
(optional): Indices of destination placesmapbox_geocoding
searchText
(string): The place or address to search forlimit
(optional): Maximum number of results (1-10)types
(optional): Filter by place types (country, region, place, etc.)language
(optional): Two-letter language codefuzzyMatch
(optional): Enable/disable fuzzy matchingAdd this configuration to your Claude Desktop config file (typically located at ~/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"
}
}
}
}
Get a Mapbox API key by following the instructions here.
Set your API key as an environment variable:
export MAPBOX_ACCESS_TOKEN=your_api_key_here
In mapbox-mcp-server, we use the following structure to manage the server's handlers:
src/server/handlers/base.ts
: Base class for all handlerssrc/server/registry.ts
: Registry for all handlerssrc/server/main.ts
: Main entry point for the serverEach feature module follows this structure:
src/
├── types/ # Type definitions
├── schemas/ # Zod schemas for validation
├── tools/
│ ├── definitions/ # Tool definitions
│ └── handlers/ # Tool implementations
└── server/
└── handlers/ # Handler classes
Class Diagram:
Process Diagram:
All tools implement comprehensive error handling:
This MCP server is licensed under the MIT License. This means you are free to use, modify, and distribute the software, subject to the terms and conditions of the MIT License. For more details, please see the LICENSE file in the project repository.
Seamless access to top MCP servers powering the future of AI integration.