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

Mapbox DevKit MCP Server

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

  • check
    Manage Mapbox styles conversationally
  • check
    Create and manage access tokens
  • check
    Access user feedback and map issues
  • check
    Preview GeoJSON and convert coordinates

The Mapbox DevKit MCP Server provides AI assistants with direct access to Mapbox developer APIs, documentation, and other helpful developer tools through the Model Context Protocol. This server helps developers build Mapbox applications more efficiently by enabling conversational interactions with style management, token creation, documentation access, and more.

Installation

Requirements:

  • Node.js LTS or later is required to build and run the DevKit MCP Server.
A Mapbox Access Token is required

You will need a Mapbox Access Token with appropriate scopes to use the DevKit 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 DevKit MCP Server

The Mapbox DevKit 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 DevKit MCP endpoint without installing or running anything locally. This endpoint is available at https://mcp-devkit.mapbox.com/mcp.

For example, Claude Desktop users can configure the hosted endpoint by adding the mcpServers key to their claude_desktop_config.json file:

{
"mcpServers": {
"MapboxDevKitServer": {
"url": "https://mcp-devkit.mapbox.com/mcp",
"env": {
"MAPBOX_ACCESS_TOKEN": "YOUR_MAPBOX_ACCESS_TOKEN"
}
}
}
}

This hosted option eliminates the need for Node.js installation or local builds, making it ideal for quick setup and testing.

Quick Start with npm

You must configure consuming applications to connect to the Mapbox DevKit 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": {
"MapboxDevKitServer": {
"command": "npx",
"args": [ "-y", "@mapbox/mcp-devkit-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": {
"MapboxDevKitServer": {
"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-devkit-server"],
"env": {
"MAPBOX_ACCESS_TOKEN": "YOUR_MAPBOX_ACCESS_TOKEN"
}
}
}
}
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.

Installation guides are available for the following applications in the public repository:

Local Deployment

To use Mapbox DevKit 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, providing your Mapbox Access Token.

Clone and build the DevKit MCP Server

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

The built DevKit 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.

Docker Configuration

You may also build and run the DevKit 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 DevKit 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": {
"MapboxDevKitServer": {
"command": "node",
"args": ["/Users/username/github-projects/mcp-devkit-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 DevKit MCP Server supports several configuration options to customize its behavior.

Environment Variables

  • MAPBOX_ACCESS_TOKEN (required): Your Mapbox access token for authenticating API requests. Different tools require different token scopes.
  • VERBOSE_ERRORS (optional): Enable enhanced error messaging for debugging purposes.

Token Scope Requirements

Different tools in the DevKit MCP Server require specific token scopes:

  • Style operations: styles:list, styles:read, styles:download, styles:write
  • Token management: tokens:read, tokens:write
  • Feedback access: user-feedback:read
  • Preview generation: tokens:read and at least one public token with styles:read

You can configure these scopes when creating your access token on the Access Tokens page.

Resources

The Mapbox DevKit MCP Server provides access to static reference data through MCP Resources. Clients can access these resources using the following URIs:

  • mapbox://docs/style-spec - Mapbox Style Specification documentation
  • mapbox://docs/token-scopes - Available token scope definitions
  • mapbox://docs/layer-types - Map layer type reference
  • mapbox://docs/field-definitions - Field definitions for various APIs

These resources provide comprehensive reference materials to help you understand Mapbox APIs and build applications more effectively.

Tools

The Mapbox DevKit MCP Server provides the following tools for managing Mapbox resources and accessing developer APIs:

ToolDescription
GetDocsToolFetches the latest Mapbox documentation from official sources to help answer questions about Mapbox APIs and features.
CreateStyleToolCreates a new Mapbox style with specified properties. Powered by the Styles API.
GetStyleToolRetrieves an existing Mapbox style by ID. Powered by the Styles API.
UpdateStyleToolUpdates an existing Mapbox style with new properties. Powered by the Styles API.
DeleteStyleToolDeletes a Mapbox style by ID. Powered by the Styles API.
ListStylesToolLists all styles associated with your Mapbox account. Powered by the Styles API.
StyleBuilderToolConversational style builder that helps create Mapbox styles through natural language interactions.
GeneratePreviewUrlToolGenerates a preview URL for a Mapbox style with customizable map parameters like center, zoom, bearing, and pitch.
CreateTokenToolCreates a new Mapbox access token with specified scopes and URL restrictions. Powered by the Tokens API.
ListTokensToolLists all access tokens for your account with optional filtering by date. Powered by the Tokens API.
GetFeedbackToolRetrieves individual user feedback items about map issues. Powered by the Feedback API.
ListFeedbackToolQueries and filters user-reported map issues and suggestions by status, category, or date. Powered by the Feedback API.
PreviewGeoJSONToolGenerates a preview URL for GeoJSON data using geojson.io for visualization.
ConvertCoordinatesToolConverts coordinates between WGS84 (EPSG:4326) and Web Mercator (EPSG:3857) projection systems.
CalculateBoundingBoxToolCalculates bounding boxes for various GeoJSON geometry types (Point, LineString, Polygon, etc.).
このpageは役に立ちましたか?