Mapbox
About
Unlock geospatial intelligence through Mapbox APIs like geocoding, POI search, directions, isochrones and more.
Details
- Author
- AidenYangX
- GitHub stars
- 12
- Downloads
- 405
- Categories
- Developer Tools, Search, Other, API
Jump to
- Directions between coordinates or place names
- Travel time and distance matrices for multiple points
- Geocoding places into coordinates with fuzzy matching
- Support for multiple travel profiles (driving, walking, cycling)
- Language selection for geocoding and route results
- Comprehensive error handling for all API calls
Setting up with Highlight
This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:
- Download and install Highlight from highlightai.com/download
- Navigate to the plugins tab and select "Add Custom Plugin"
-
Configure the plugin with the settings below
Plugin Name
MapboxCommand (node, npx, python, etc.)Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.
- Enable "Start Automatically" if you want the plugin to start when Highlight launches
From the repository
Install Node.js 16+, TypeScript 4.5+, and obtain a Mapbox API key. Add the server configuration to your Claude Desktop config file (claude_desktop_config.json) with the command node, an absolute path to the built server, and the MAPBOX_ACCESS_TOKEN environment variable. Then invoke tools like mapbox_directions, mapbox_matrix, or mapbox_geocoding with the required parameters.
Claude Desktop / Cursor
Paste into your MCP client config file to install this server.
{
"mcpServers": {
"mapbox": {
"mapbox-mcp-server": {
"command": "node",
"args": [
"/absolute/path/to/mapbox-mcp-server/build/index.js"
],
"env": {
"MAPBOX_ACCESS_TOKEN": "your-api-key"
}
}
}
}
}
McpServers
{
"mapbox-mcp-server": {
"command": "node",
"args": [
"/absolute/path/to/mapbox-mcp-server/build/index.js"
],
"env": {
"MAPBOX_ACCESS_TOKEN": "your-api-key"
}
}
}
- Search and geocode places— Ask for addresses, POIs, or landmarks viasearch_and_geocode_tool, with optional category filtering and language support.
- Get turn-by-turn directions— Request driving, walking, or cycling routes with live traffic, waypoints, and exclusions viadirections_tool.
- Visualize results on a live map— Userender_map_toolto display routes, search results, or custom GeoJSON as an interactive map in chat.
- Run offline geospatial calculations— Compute distances, areas, bearings, buffers, and centroids locally with tools likedistance_toolandbuffer_tool, no API calls needed.
- Snap GPS traces to roads— Clean up noisy coordinates and match them to the road network usingmap_matching_toolwith optional timestamps.
- Optimize multi-stop routes— Solve the traveling salesman problem for up to 12 locations withoptimization_tool, supporting roundtrips or one-way trips.
Node.js server implementing Model Context Protocol (MCP) for Mapbox APIs.
Unlock Geospatial Intelligence for Your AI Applications
The Mapbox MCP Server transforms any AI agent or application into a geospatially-aware system by providing seamless access to Mapbox's comprehensive location intelligence platform. With this server, your AI can understand and reason about places, navigate the physical world, and access rich geospatial data including:
- Global geocodingto convert addresses and place names to coordinates and vice versa
- Points of interest (POI) searchacross millions of businesses, landmarks, and places worldwide
- Multi-modal routingfor driving, walking, and cycling with real-time traffic
- Travel time matricesto analyze accessibility and optimize logistics
- Route optimizationto find the optimal visiting order for multiple stops (traveling salesman problem)
- Map matchingto snap GPS traces to the road network for clean route visualization
- Isochrone generationto visualize areas reachable within specific time or distance constraints
- Live, interactive map rendering(render_map_tool) to display routes, search results, and your own custom GeoJSON on a real Mapbox GL JS map directly inside the chat
- Static map imagesto create visual representations of locations, routes, and geographic data
- Offline geospatial calculationsfor distance, area, bearing, buffers, and spatial analysis without requiring API calls
Whether you're building an AI travel assistant, logistics optimizer, location-based recommender, or any application that needs to understand "where", the Mapbox MCP Server provides the spatial intelligence to make it possible. You can also enable it on popular clients like Claude Desktop and VS Code. See below for details
A Mapbox access token is required to use this MCP server.
For quick access, you can use our hosted MCP endpoint:
For detailed setup instructions for different clients and API usage, see theHosted MCP Server Guide.
- Sign up for a free Mapbox account atmapbox.com/signup
- Navigate to yourAccount page
- Create a new token or use the default public token
For more information about Mapbox access tokens, see theMapbox documentation on access tokens.
For detailed setup instructions for different integrations, refer to the following guides:
- Claude Desktop Setup- Instructions for configuring Claude Desktop to work with this MCP server
- Goose Setup- Setting up Goose AI agent framework
- VS Code Setup- Setting up a development environment in Visual Studio Code
- Cursor AI IDE Setup- Setting up a development environment in Cursor AI IDE
- Smolagents Integration- Example showing how to connect Smolagents AI agents to Mapbox's tools
- Importing Tools Directly- Use Mapbox tools in your own applications without running the MCP server
- render_map_toolGuide- The map visualization primitive: full payload schema and how to render your own data standalone, without any other Mapbox tool
- Elicitations- Howsearch_and_geocode_toolanddirections_toolask the user to disambiguate results or pick a route, and how they fall back gracefully when the client doesn't support it
Try these prompts with Claude Desktop or other MCP clients after setup:
For coordinate-first queries —"what's near me","what neighborhood is this","what's reachable in N minutes"— useground_location_tool. It composes reverse geocoding, category search, and isochrone in a single call, adaptively choosing the right strategy based on the query, and returns typed records (names, addresses, coordinates, distances, reachability polygons) with citations.
Each of the four prompts below exercises a different strategy in one tool call:
- Neighborhood—"What neighborhood is 47.6097, -122.3408, and what's around me?"
- POI—"Coffee shops within a 10-minute walk of 40.7580, -73.9855"
- Region—"What can I reach in a 15-minute walk from 37.7749, -122.4194?"
- Routing—"Closest routable point to drop someone off at 34.0522, -118.2437"
- "Find coffee shops within walking distance of the Empire State Building"
- "I want to go from Seattle to Portland, is there a Starbucks along the way?"
- "Show me gas stations along the route from Boston to New York"
- "What restaurants are near Times Square?"
- "Get driving directions from LAX to Hollywood with current traffic"
- "How long would it take to walk from Central Park to Times Square?"
- "Calculate travel time from my hotel (Four Seasons) to JFK Airport by taxi during rush hour"
- "Using the Mapbox map render tool, show me directions from the Golden Gate Bridge to Union Square in San Francisco" — renders a live, interactive route on a real Mapbox map
- "Create a map image showing the route from Golden Gate Bridge to Fisherman's Wharf with markers at both locations"
- "Show me a satellite view of Manhattan with key landmarks marked"
- "Generate a map highlighting all Starbucks locations within a mile of downtown Seattle"
- "Show a fill polygon over these coordinates: [...], with a marker labeled 'Warehouse' at [...]" — renders your own GeoJSON directly viarender_map_tool, no other Mapbox tool needed
- "Show me areas reachable within 30 minutes of downtown Portland by car"
- "Calculate a travel time matrix between these 3 hotel locations (Marriott, Sheraton and Hilton) and the convention center in Denver"
- "Find the optimal route visiting these 3 tourist attractions (Golden Gate, Musical Stairs and Fisherman's Wharf) in San Francisco"
- "Optimize a delivery route for these 8 addresses: [list of addresses]"
- "Clean up this GPS trace and show the actual route on roads: [list of coordinates with timestamps]"
- "Snap this recorded bicycle ride to the cycling network: [GPS coordinates]"
- "Match this driving route to the road network and show traffic congestion levels"
- "What's the distance in miles between these two coordinates?"
- "Calculate the area of this polygon in square kilometers"
- "Is the point at 37.7749°N, 122.4194°W inside this service area polygon?"
- "What's the bearing from San Francisco to New York?"
- "Find the midpoint between London and Paris"
- "Create a 5-mile buffer zone around this location"
- "Calculate the centroid of this neighborhood boundary"
- "What's the bounding box for these route coordinates?"
- "Simplify this complex polygon to reduce the number of points"
- Be specific about locations (use full addresses or landmark names)
- Specify your preferred travel method (driving, walking, cycling)
- Include time constraints when relevant ("during rush hour", "at 3 PM")
- Ask for specific output formats when needed ("as a map image", "in JSON format")
Detailed examples:Seeexamples/search-along-route.mdfor comprehensive examples of the search-along-route prompt with different use cases and MCP Inspector testing instructions.
The MCP server exposes static reference data asMCP resources. Resources provide read-only access to data that clients can reference directly without making tool calls.
URI Pattern:mapbox://categoriesormapbox://categories/{language}
Access the complete list of available category IDs for use with the category search tool. Categories can be used to filter search results by type (e.g., "restaurant", "hotel", "gas_station").
- mapbox://categories- Default (English) category list
- mapbox://categories/ja- Japanese category names
- mapbox://categories/es- Spanish category names
- Clients with native MCP resource support: Use theresources/readMCP protocol method
- Clients without resource support: Use theresource_reader_toolwith the resource URI
Every geospatial tool in this server (directions, isochrone, search, and more) can display its result as a live, interactive Mapbox GL JS map viarender_map_tool— the server's single visualization primitive. It renders through theMCP Appsprotocol (@modelcontextprotocol/ext-apps) as a self-contained HTML panel directly inside the chat, with a Fullscreen toggle, in supported clients:
- Claude Desktop✅
- VS Code with GitHub Copilot✅
- Claude Code✅
- Goose✅
You don't need any of this server's other tools to use it.render_map_toolalso accepts hand-composed GeoJSON directly — your own polygons, markers, and routes — with no dependency ondirections_tool,isochrone_tool, or any other Mapbox API call. Seethe fullrender_map_toolguidefor the payload schema and a complete standalone example.
If you need a guaranteed static image in clients without MCP Apps support, usestatic_map_image_toolinstead — it returns a base64-encoded PNG/JPEG that every client can display.
Resource Fallback Tools (Opt-In for Non-Compliant Clients)
Resources are a core MCP feature supported by most clients (Claude Desktop, VS Code, MCP Inspector, etc.). However, some clients (like smolagents) don't support resources at all. For these clients, the server can provide "resource fallback tools" that deliver the same content as resources but via tool calls.
- resource_reader_tool- Generic fallback for reading any resource by URI
- category_list_tool- Provides access to category list (mapbox://categories)
By default, these tools are NOT included(assumes your client supports resources). If your client doesn't support resources, enable the fallback tools:
export CLIENT_NEEDS_RESOURCE_FALLBACK=true
- ✅ Set totrueif using smolagents or other clients without resource support
- ❌ Leave unset (default) if using Claude Desktop, VS Code, MCP Inspector, or any resource-capable client
- ❌ Leave unset if unsure (most clients support resources)
Provides access to MCP resources for clients that don't support the native MCP resource API. Use this tool to read resources like the category list.
- uri: The resource URI to read (e.g.,mapbox://categories,mapbox://categories/ja)
- Read default categories:{"uri": "mapbox://categories"}
- Read Japanese categories:{"uri": "mapbox://categories/ja"}
Note: If your MCP client supports native resources, prefer using the resource API directly for better performance.
These tools perform geospatial calculations completely offline without requiring Mapbox API calls. They useTurf.jsfor accurate geographic computations and work anywhere, even without internet connectivity.
Calculate the distance between two geographic coordinates using the Haversine formula.
- Supports multiple units: kilometers, miles, meters, feet, nautical miles
- Accurate great-circle distance calculation
- No API calls required
Example Usage: "What's the distance between San Francisco (37.7749°N, 122.4194°W) and New York (40.7128°N, 74.0060°W)?"
Test one or more points against a polygon or multipolygon, returning only those inside. Handles a single point or a batch in one call.
- Works with complex polygons including holes
- Supports multipolygons
- Batch-tests any number of points in one call
- Useful for geofencing, delivery zone validation, and customer segmentation
Example Usage: "Which of these delivery addresses are inside our service area?"
Calculate a destination point given a starting point, bearing, and distance using geodesic (great-circle) offset.
- Straight-line offset, not a routed path
- Useful for "find a point 5km north of X" or constructing search offsets
- No API calls required
Example Usage: "What's the point 10km northeast of the Space Needle?"
Calculate the compass direction (bearing) from one coordinate to another.
- Returns bearing in degrees (0-360°)
- Provides cardinal direction (N, NE, E, SE, S, SW, W, NW)
- Useful for navigation and directional queries
Example Usage: "What direction should I head to go from here to the airport?"
Find the geographic midpoint between two coordinates along the great circle path.
- Calculates true midpoint on Earth's curved surface
- Useful for meeting point suggestions
- Handles long-distance calculations correctly
Example Usage: "What's halfway between San Francisco and New York?"
Calculate the geometric center (centroid) of a polygon or multipolygon.
- Works with complex shapes
- Returns arithmetic mean of all points
- Useful for placing labels or markers
Example Usage: "Where should I place a marker for this neighborhood boundary?"
- Supports multiple units: square meters, square kilometers, acres, hectares, square miles, square feet
- Accurate area calculation on Earth's surface
- Works with polygons of any size
Example Usage: "What's the area of this park in acres?"
Calculate the minimum bounding box (bbox) that contains a geometry.
- Works with points, lines, polygons, and multipolygons
- Returns [minLongitude, minLatitude, maxLongitude, maxLatitude]
- Useful for viewport calculations and spatial indexing
Example Usage: "What's the bounding box for this route?"
Create a buffer zone (polygon) around a point, line, or polygon.
- Supports multiple distance units
- Creates circular buffers around points
- Useful for proximity analysis and creating zones of influence
Example Usage: "Show me a 5km buffer zone around this location"
Reduce the number of vertices in a line or polygon using the Douglas-Peucker algorithm.
- Configurable tolerance for detail level
- Preserves overall shape while reducing complexity
- Useful for reducing file sizes and improving rendering performance
- Option to maintain topology (prevent self-intersections)
Example Usage: "Simplify this complex boundary to reduce the number of points"
Measure the total length of a line defined by a series of coordinates.
- Supports kilometers, miles, meters, and feet
- Useful for measuring a drawn route, path, or boundary without a routing API call
Example Usage: "How long is this hiking trail?"
Compute the convex hull of a set of points — the smallest convex polygon containing all of them.
- Useful for bounding-area analysis or estimating coverage area
- Works offline without API calls
Sign in to leave a review
Use Google, GitHub, or an email account so ratings stay tied to real people.
No reviews posted yet.




