This guide explains how to configure Visual Studio Code for use with the Mapbox MCP DevKit Server.
- Visual Studio Code installed
- GitHub Copilot extension installed and configured
- Mapbox MCP DevKit Server built locally
# from repository root:
# using node
npm install
npm run build
# or alternatively, using docker
docker build -t mapbox-mcp-devkit .-
Open your VS Code
settings.jsonfile:- Mac/Linux:
Cmd+Shift+P→ "Preferences: Open User Settings (JSON)" - Windows:
Ctrl+Shift+P→ "Preferences: Open User Settings (JSON)"
- Mac/Linux:
-
At the top level of the JSON file, add the MCP configuration:
-
NPM version (recommended for simplicity)
"mcp": { "servers": { "MapboxDevKit": { "type": "stdio", "command": "npx", "args": ["-y", "@mapbox/mcp-devkit-server"], "env": { "MAPBOX_ACCESS_TOKEN": "<YOUR_TOKEN>" } } } }
-
Docker version (recommended for isolation)
"mcp": { "servers": { "MapboxDevKit": { "type": "stdio", "command": "docker", "args": [ "run", "-i", "--rm", "--env", "MAPBOX_ACCESS_TOKEN=<YOUR_TOKEN>", "mapbox-mcp-devkit" ] } } }
-
Node version (for local development)
"mcp": { "servers": { "MapboxDevKit": { "type": "stdio", "command": "node", "args": [ "/absolute/path/to/repo/dist/esm/index.js" ], "env": { "MAPBOX_ACCESS_TOKEN": "<YOUR_TOKEN>" } } } }
-
-
Save the
settings.jsonfile. -
Restart VS Code to apply the changes.
After restarting VS Code, you should see "Mapbox DevKit" appear in the GitHub Copilot tools menu or MCP servers list.
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)
Here's a complete settings.json example with the NPM version:
{
"editor.fontSize": 14,
"editor.tabSize": 2,
"mcp": {
"servers": {
"MapboxDevKit": {
"type": "stdio",
"command": "npx",
"args": ["-y", "@mapbox/mcp-devkit-server"],
"env": {
"MAPBOX_ACCESS_TOKEN": "pk.eyJ1IjoiZXhhbXBsZSIsImEiOiJjbGV4YW1wbGUifQ.example"
}
}
}
}
}If the Mapbox DevKit Server doesn't appear in VS Code's MCP servers:
- Check GitHub Copilot: Ensure GitHub Copilot is installed and active
- Verify token: Check that your
MAPBOX_ACCESS_TOKENis valid - Docker image: If using Docker, verify the image exists:
docker images | grep mapbox-mcp-devkit - Check Output: Open "Output" panel → Select "MCP" from dropdown to see logs
If you see JSON-RPC or parsing errors in the Output panel:
- Build fresh: Run
npm run buildto ensure you have the latest build - Path verification: For Node version, verify the path to
dist/esm/index.jsis correct and absolute - Check logs: Open "Output" panel → Select "MCP" from dropdown to see detailed logs
If tools fail to execute:
- Token scopes: Verify your Mapbox token has the required scopes (see README)
- Rate limits: Check if you're hitting API rate limits (429 errors)
- Verbose errors: Add
"VERBOSE_ERRORS": "true"to the env config for detailed error messages - Network: Ensure you can reach
api.mapbox.comfrom your network
Once configured, you can use natural language in GitHub Copilot Chat to interact with Mapbox tools:
@MapboxDevKit list all my Mapbox styles
@MapboxDevKit show me the bounding box for Tokyo, Japan
@MapboxDevKit convert these coordinates to lat/lng: -122.4194, 37.7749
@MapboxDevKit create a new Mapbox style called 'dark-mode-map'
See the README for more example prompts and available tools.