The Mapbox Docs MCP Server gives AI assistants direct access to Mapbox documentation through the Model Context Protocol, an open standard for AI tools to connect with external services. It provides full-text search across all Mapbox docs and retrieval of complete documentation pages, helping AI assistants answer questions about Mapbox APIs, SDKs, and developer tools accurately and up to date.
Installation
Requirements:
- Node.js version 22 or later is required to build and run the Docs MCP Server.
The Mapbox Docs MCP Server accesses only public documentation and does not require a Mapbox Access Token. You can start using it at once without any authentication setup.
Use the Mapbox Docs MCP Server
The Mapbox Docs 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 Docs MCP endpoint without installing or running anything locally. This endpoint is available at https://mcp-docs.mapbox.com/mcp.
Configure your AI assistant to use the hosted endpoint:
{
"mcpServers": {
"mapbox-docs-mcp": {
"command": "npx",
"args": [
"mcp-remote",
"https://mcp-docs.mapbox.com/mcp"
]
}
}
}
{
"servers": {
"mapbox-docs-mcp": {
"type": "http",
"url": "https://mcp-docs.mapbox.com/mcp"
}
}
}
{
"mcpServers": {
"mapbox-docs-mcp": {
"type": "http",
"url": "https://mcp-docs.mapbox.com/mcp"
}
}
}
$claude mcp add --transport http mapbox-docs-mcp https://mcp-docs.mapbox.com/mcp
$codex mcp add mapbox-docs-mcp --url https://mcp-docs.mapbox.com/mcp
Quick Start with npm
You must configure consuming applications to connect to the Mapbox Docs MCP Server. This typically involves referencing the MCP Server's NPM package via npx.
Configure your AI assistant to use the Mapbox Docs MCP Server via npm:
{
"mcpServers": {
"MapboxDocsServer": {
"command": "npx",
"args": [
"-y",
"@mapbox/mcp-docs-server"
],
"env": {
"MAPBOX_ACCESS_TOKEN": "YOUR_MAPBOX_ACCESS_TOKEN"
}
}
}
}
{
"servers": {
"MapboxDocsServer": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@mapbox/mcp-docs-server"
],
"env": {
"MAPBOX_ACCESS_TOKEN": "YOUR_MAPBOX_ACCESS_TOKEN"
}
}
}
}
{
"mcpServers": {
"MapboxDocsServer": {
"command": "npx",
"args": [
"-y",
"@mapbox/mcp-docs-server"
],
"env": {
"MAPBOX_ACCESS_TOKEN": "YOUR_MAPBOX_ACCESS_TOKEN"
}
}
}
}
$claude mcp add --transport stdio MapboxDocsServer -- npx -y @mapbox/mcp-docs-server
# Set the required environment variable:
$export MAPBOX_ACCESS_TOKEN=YOUR_MAPBOX_ACCESS_TOKEN
$codex mcp add MapboxDocsServer --env MAPBOX_ACCESS_TOKEN=YOUR_MAPBOX_ACCESS_TOKEN -- npx -y @mapbox/mcp-docs-server
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": {
"MapboxDocsServer": {
"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-docs-server"]
}
}
}
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.
Local Deployment
To use the Mapbox Docs 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.
Clone and build the Docs MCP Server
- Clone the repository:
$git clone https://github.com/mapbox/mcp-docs-server.git
- Change into the project directory:
$cd mcp-docs-server
- Install dependencies:
$npm install
- Build the project:
$npm run build
The built Docs 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.
Configure the consuming application
You must configure consuming applications to connect to the Mapbox Docs MCP Server. This typically involves specifying the path to the MCP Server node.js file.
Configure your AI assistant to use the local Docs MCP Server build:
{
"mcpServers": {
"MapboxDocsServer": {
"command": "node",
"args": [
"/Users/username/github-projects/mcp-docs-server/dist/esm/index.js"
],
"env": {
"MAPBOX_ACCESS_TOKEN": "YOUR_MAPBOX_ACCESS_TOKEN"
}
}
}
}
{
"servers": {
"MapboxDocsServer": {
"type": "stdio",
"command": "node",
"args": [
"/Users/username/github-projects/mcp-docs-server/dist/esm/index.js"
],
"env": {
"MAPBOX_ACCESS_TOKEN": "YOUR_MAPBOX_ACCESS_TOKEN"
}
}
}
}
{
"mcpServers": {
"MapboxDocsServer": {
"command": "node",
"args": [
"/Users/username/github-projects/mcp-docs-server/dist/esm/index.js"
],
"env": {
"MAPBOX_ACCESS_TOKEN": "YOUR_MAPBOX_ACCESS_TOKEN"
}
}
}
}
$claude mcp add --transport stdio MapboxDocsServer -- node /Users/username/github-projects/mcp-docs-server/dist/esm/index.js
# Set the required environment variable:
$export MAPBOX_ACCESS_TOKEN=YOUR_MAPBOX_ACCESS_TOKEN
$codex mcp add MapboxDocsServer --env MAPBOX_ACCESS_TOKEN=YOUR_MAPBOX_ACCESS_TOKEN -- node /Users/username/github-projects/mcp-docs-server/dist/esm/index.js
Consult the documentation of your AI model or application for specific instructions on how to configure MCP servers.
Configuration
The Mapbox Docs MCP Server supports several configuration options to customize its behavior.
Command-Line Flags
When running the server locally, you can use the following command-line flags:
--enable-tools=<tool_names>: Activate only specified tools (comma-separated, case-sensitive). Example:--enable-tools=search_mapbox_docs_tool--disable-tools=<tool_names>: Remove designated tools while keeping others active (comma-separated, case-sensitive). Example:--disable-tools=batch_get_documents_tool
When both --enable-tools and --disable-tools are provided, the enable option takes precedence.
OpenTelemetry Configuration
The Docs MCP Server supports optional distributed tracing via OpenTelemetry. Tracing is disabled by default.
OTEL_TRACING_ENABLED(optional): Set totrueto enable OpenTelemetry tracing.OTEL_SERVICE_NAME(optional): Service identification name. Defaults tomapbox-mcp-docs-server.OTEL_EXPORTER_OTLP_ENDPOINT(optional): OTLP HTTP exporter endpoint URL (e.g.,http://localhost:4318).OTEL_EXPORTER_OTLP_HEADERS(optional): JSON-formatted headers for the OTLP exporter.OTEL_EXPORTER_CONSOLE_ENABLED(optional): Set totrueto log traces to the console for debugging.
Resources
The Mapbox Docs MCP Server provides access to documentation indexes and reference data through MCP Resources. Clients can access these resources using the following URIs:
resource://mapbox-api-reference- REST API reference organized by service (Maps, Navigation, Search, Accounts)resource://mapbox-sdk-docs- Mapbox GL JS documentation including getting started, styling layers, API reference, and code examples. For mobile SDK docs (iOS, Android, Flutter), usesearch_mapbox_docs_toolorresource://mapbox-referenceresource://mapbox-guides- Help Center documentation including troubleshooting guides, tutorials, and account setup walkthrough guidesresource://mapbox-examples- Interactive API playgrounds, demo applications, and code examplesresource://mapbox-reference- Complete catalog of all Mapbox products and documentation sectionsresource://mapbox-style-layers- Style layer types, paint and layout properties reference, and Streets v8 source layer mappingresource://mapbox-streets-v8-fields- Streets v8 source layer field definitions with enumerated valuesresource://mapbox-token-scopes- Token scope documentation including public and secret scope definitionsresource://mapbox-layer-type-mapping- Streets v8 source layer to GL JS layer type compatibility matrix
These resources provide comprehensive reference materials to help AI assistants answer questions about Mapbox APIs, build applications more effectively, and work with style specifications.
Tools
The Mapbox Docs MCP Server provides the following tools for searching and retrieving Mapbox documentation. No Mapbox access token is required for any of these tools.
| Tool | Description |
|---|---|
search_mapbox_docs_tool | Searches Mapbox documentation by keyword or natural language query. Fetches and indexes product-level llms.txt files from docs.mapbox.com, covering the API reference, GL JS, Help Center, Style Spec, Studio, Search JS, iOS and Android Maps and Navigation SDKs, and Tilesets. Index files are cached for one hour. Returns ranked results with titles, URLs, and descriptions. Configurable result limit (default 5, max 20). |
get_document_tool | Fetches the full content of a specific Mapbox documentation page by URL. Use this after a search to retrieve complete page content. Only accepts mapbox.com domain URLs. Responses are cached for one hour. |
batch_get_documents_tool | Fetches multiple Mapbox documentation pages in a single call (maximum 20 URLs). More efficient than repeated get_document_tool calls. Returns an array of results with per-item error handling so that a failed page does not fail the entire batch. |