This guide explains how to configure Cursor IDE for use with the Mapbox MCP DevKit Server.
- Cursor installed
- Mapbox MCP DevKit Server built locally
# from repository root:
# using node
npm run build
# or alternatively, using docker
docker build -t mapbox-mcp-devkit .-
Go to Cursor Settings/ MCP Tools and click on "Add Custom MCP".
-
Add either of the following MCP config:
-
NPM version (recommended for simplicity)
{ "mcpServers": { "MapboxDevKit": { "type": "stdio", "command": "npx", "args": ["-y", "@mapbox/mcp-devkit-server"], "env": { "MAPBOX_ACCESS_TOKEN": "<YOUR_TOKEN>", "MCP_LOGGING_DISABLE": "true" } } } } -
Docker version (recommended for isolation)
{ "mcpServers": { "MapboxDevKit": { "type": "stdio", "command": "docker", "args": [ "run", "-i", "--rm", "--env", "MAPBOX_ACCESS_TOKEN=<YOUR_TOKEN>", "--env", "MCP_LOGGING_DISABLE=true", "mapbox-mcp-devkit" ] } } } -
Node version (for local development)
{ "mcpServers": { "MapboxDevKit": { "type": "stdio", "command": "node", "args": ["<ABSOLUTE_PATH_TO_REPO>/dist/esm/index.js"], "env": { "MAPBOX_ACCESS_TOKEN": "<YOUR_TOKEN>", "MCP_LOGGING_DISABLE": "true" } } } }
-
-
Click "Save" to apply the configuration.
The MCP DevKit Server uses stdio (standard input/output) for communication with Cursor. To prevent console logs from corrupting the JSON-RPC protocol, you must set MCP_LOGGING_DISABLE=true in the environment variables.
Your Mapbox access token must have the appropriate scopes for the tools you want to use. See the main README for required token scopes per tool.
Additional environment variables you can set:
OTEL_EXPORTER_OTLP_ENDPOINT- Enable OpenTelemetry tracing (see tracing docs)OTEL_SERVICE_NAME- Override service name for tracingMAPBOX_API_ENDPOINT- Override Mapbox API endpoint (advanced)
If the Mapbox DevKit Server doesn't appear in Cursor's MCP tools:
- Check that your
MAPBOX_ACCESS_TOKENis valid - Verify
nodeandnpxare in your PATH (runwhich nodeorwhich npx) - For Docker: ensure the image is built with
docker images | grep mapbox-mcp-devkit - Check Cursor's logs for any error messages
If you get "command not found" errors for node or npx:
-
Find the absolute path:
# Mac/Linux which node which npx # Windows where node where npx
-
Use the absolute path in your config:
{ "mcpServers": { "MapboxDevKit": { "command": "/usr/local/bin/npx", // Use your actual path ... } } }
If you see JSON-RPC or parsing errors:
- Ensure
MCP_LOGGING_DISABLEis set to"true"in your configuration - If using Node version, verify the path to
dist/esm/index.jsis correct - Run
npm run buildto ensure the latest build is available
If tools fail to execute:
- Verify your Mapbox token has the required scopes (see README)
- Check if you're hitting rate limits (429 errors)
- Enable verbose errors by adding
"VERBOSE_ERRORS": "true"to the env config
Once configured, you can use natural language to interact with Mapbox tools:
- "List all my Mapbox styles"
- "Show me the bounding box for San Francisco"
- "Convert these coordinates to lat/lng: -122.4194, 37.7749"
- "Create a new Mapbox style called 'my-custom-map'"
See the README for more example prompts.