メインコンテンツまでスキップ

Mapbox Docs MCP Server

現在のバージョン:v0.3.0

  • check
    Search Mapbox documentation with full-text search
  • check
    Fetch complete documentation pages by URL
  • check
    Retrieve multiple documentation pages in a single call
  • check
    Access reference data for styles, tokens, and APIs

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.
No Mapbox Access Token required

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:

claude_desktop_config.json
{
"mcpServers": {
"mapbox-docs-mcp": {
"command": "npx",
"args": [
"mcp-remote",
"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:

claude_desktop_config.json
{
"mcpServers": {
"MapboxDocsServer": {
"command": "npx",
"args": [
"-y",
"@mapbox/mcp-docs-server"
],
"env": {
"MAPBOX_ACCESS_TOKEN": "YOUR_MAPBOX_ACCESS_TOKEN"
}
}
}
}
Note

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"]
}
}
}
Note

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:

  1. Clone the MCP Server code repository and build the project.
  2. Configure a consuming application to run and connect to the MCP Server.

Clone and build the Docs MCP Server

  1. Clone the repository:
$git clone https://github.com/mapbox/mcp-docs-server.git
  1. Change into the project directory:
$cd mcp-docs-server
  1. Install dependencies:
$npm install
  1. Build the project:
$npm run build

The built Docs MCP Server will be located in the dist directory in two formats:

  • dist/esm/index.js for ESM (ECMAScript Module) support
  • dist/commonjs/index.js for 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:

claude_desktop_config.json
{
"mcpServers": {
"MapboxDocsServer": {
"command": "node",
"args": [
"/Users/username/github-projects/mcp-docs-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.

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 to true to enable OpenTelemetry tracing.
  • OTEL_SERVICE_NAME (optional): Service identification name. Defaults to mapbox-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 to true to 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), use search_mapbox_docs_tool or resource://mapbox-reference
  • resource://mapbox-guides - Help Center documentation including troubleshooting guides, tutorials, and account setup walkthrough guides
  • resource://mapbox-examples - Interactive API playgrounds, demo applications, and code examples
  • resource://mapbox-reference - Complete catalog of all Mapbox products and documentation sections
  • resource://mapbox-style-layers - Style layer types, paint and layout properties reference, and Streets v8 source layer mapping
  • resource://mapbox-streets-v8-fields - Streets v8 source layer field definitions with enumerated values
  • resource://mapbox-token-scopes - Token scope documentation including public and secret scope definitions
  • resource://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.

ToolDescription
search_mapbox_docs_toolSearches 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_toolFetches 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_toolFetches 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.
このpageは役に立ちましたか?