Skip to content

Commit 0e3fe76

Browse files
[otel] Update DevKit Server docs with OTEL information
1 parent 57d19d1 commit 0e3fe76

11 files changed

Lines changed: 463 additions & 21 deletions

File tree

.env.example

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,11 @@ OTEL_RESOURCE_ATTRIBUTES=service.name=mapbox-mcp-devkit-server,service.version=0
3939
# ⚠️ Do NOT enable with stdio transport - it breaks JSON-RPC communication
4040
# OTEL_EXPORTER_CONSOLE_ENABLED=true
4141

42+
# Optional: OTEL diagnostic log level (default: NONE to avoid stdio pollution)
43+
# Set to DEBUG, INFO, WARN, or ERROR for troubleshooting OTEL issues
44+
# ⚠️ Only use for debugging - logs will corrupt stdio transport
45+
# OTEL_LOG_LEVEL=ERROR
46+
4247
# Optional: OTLP authentication headers (for production backends)
4348
# OTEL_EXPORTER_OTLP_HEADERS={"Authorization": "Bearer your-token"}
4449

CLAUDE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ This server includes OpenTelemetry (OTEL) instrumentation for distributed tracin
6060
- `OTEL_TRACING_ENABLED` — Set to `false` to explicitly disable tracing even if endpoint is configured
6161
- `OTEL_SERVICE_NAME` — Override service name (default: `mapbox-mcp-devkit-server`)
6262
- `OTEL_EXPORTER_OTLP_HEADERS` — JSON string of additional headers for OTLP exporter
63+
- `OTEL_LOG_LEVEL` — OTEL diagnostic log level: `NONE` (default), `ERROR`, `WARN`, `INFO`, `DEBUG`, `VERBOSE`. Set to `NONE` to prevent OTEL logs from polluting stdio transport.
6364

6465
### What Gets Traced
6566

README.md

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,20 @@ https://github.com/user-attachments/assets/8b1b8ef2-9fba-4951-bc9a-beaed4f6aff6
2727
- [Coordinate Conversion tool](#coordinate-conversion-tool)
2828
- [Bounding Box tool](#bounding-box-tool)
2929
- [Resources](#resources)
30-
- [Observability & Tracing](#observability--tracing)
30+
- [Observability \& Tracing](#observability--tracing)
31+
- [Features](#features)
32+
- [Quick Start with Jaeger](#quick-start-with-jaeger)
33+
- [Supported Backends](#supported-backends)
34+
- [Documentation](#documentation)
35+
- [Environment Variables](#environment-variables)
3136
- [Development](#development)
3237
- [Testing](#testing)
3338
- [Tool Snapshot Tests](#tool-snapshot-tests)
3439
- [Inspecting Server](#inspecting-server)
3540
- [Using Node.js](#using-nodejs)
3641
- [Using Docker](#using-docker)
3742
- [Creating New Tools](#creating-new-tools)
38-
- [Environment Variables](#environment-variables)
43+
- [Environment Variables](#environment-variables-1)
3944
- [VERBOSE_ERRORS](#verbose_errors)
4045
- [Troubleshooting](#troubleshooting)
4146
- [Contributing](#contributing)
@@ -48,6 +53,8 @@ Get started by integrating with your preferred AI development environment:
4853

4954
- [Claude Code Integration](./docs/claude-code-integration.md) - Command-line development with Claude
5055
- [Claude Desktop Integration](./docs/claude-desktop-integration.md) - Desktop application integration
56+
- [Cursor Integration](./docs/cursor-integration.md) - Cursor IDE integration
57+
- [VS Code Integration](./docs/vscode-integration.md) - Visual Studio Code with GitHub Copilot
5158

5259
### DXT Package Distribution
5360

@@ -592,11 +599,8 @@ npm test -- --updateSnapshot
592599
#### Using Node.js
593600

594601
```sh
595-
# Build
596-
npm run build
597-
598-
# Inspect
599-
npx @modelcontextprotocol/inspector node dist/esm/index.js
602+
# Run the built image
603+
npm run inspect:build
600604
```
601605

602606
#### Using Docker
@@ -606,7 +610,7 @@ npx @modelcontextprotocol/inspector node dist/esm/index.js
606610
docker build -t mapbox-mcp-devkit .
607611

608612
# Run and inspect the server
609-
npx @modelcontextprotocol/inspector docker run -i --rm --env MAPBOX_ACCESS_TOKEN="YOUR_TOKEN" mapbox-mcp-devkit
613+
npx @modelcontextprotocol/inspector docker run -i --rm --env MAPBOX_ACCESS_TOKEN="YOUR_TOKEN" --env MCP_LOGGING_DISABLE="true" mapbox-mcp-devkit
610614
```
611615

612616
### Creating New Tools

docs/claude-code-integration.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ Add to your Claude Code MCP configuration:
6060
"command": "npx",
6161
"args": ["-y", "@mapbox/mcp-devkit-server"],
6262
"env": {
63-
"MAPBOX_ACCESS_TOKEN": "your_token_here"
63+
"MAPBOX_ACCESS_TOKEN": "your_token_here",
64+
"MCP_LOGGING_DISABLE": "true"
6465
}
6566
}
6667
}
@@ -80,6 +81,8 @@ Add to your Claude Code MCP configuration:
8081
"--rm",
8182
"-e",
8283
"MAPBOX_ACCESS_TOKEN=your_token_here",
84+
"-e",
85+
"MCP_LOGGING_DISABLE": "true",
8386
"mapbox-mcp-devkit"
8487
]
8588
}
@@ -98,7 +101,8 @@ If you want to use a local version (need to clone and build from this repo):
98101
"command": "/path/to/your/node",
99102
"args": ["/path/to/mapbox-mcp-devkit/dist/esm/index.js"],
100103
"env": {
101-
"MAPBOX_ACCESS_TOKEN": "your_token_here"
104+
"MAPBOX_ACCESS_TOKEN": "your_token_here",
105+
"MCP_LOGGING_DISABLE": "true"
102106
}
103107
}
104108
}
@@ -196,6 +200,7 @@ Enable verbose error reporting by adding the environment variable:
196200
"args": ["-y", "@mapbox/mcp-devkit-server"],
197201
"env": {
198202
"MAPBOX_ACCESS_TOKEN": "your_token_here",
203+
"MCP_LOGGING_DISABLE": "true",
199204
"VERBOSE_ERRORS": "true"
200205
}
201206
}

docs/claude-desktop-integration.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,8 @@ For users who prefer manual configuration or need custom setups, you can configu
7171
"command": "npx",
7272
"args": ["-y", "@mapbox/mcp-devkit-server"],
7373
"env": {
74-
"MAPBOX_ACCESS_TOKEN": "your_token_here"
74+
"MAPBOX_ACCESS_TOKEN": "your_token_here",
75+
"MCP_LOGGING_DISABLE": "true"
7576
}
7677
}
7778
}
@@ -91,6 +92,8 @@ For users who prefer manual configuration or need custom setups, you can configu
9192
"--rm",
9293
"-e",
9394
"MAPBOX_ACCESS_TOKEN=your_token_here",
95+
"-e",
96+
"MCP_LOGGING_DISABLE": "true",
9497
"mapbox-mcp-devkit"
9598
]
9699
}
@@ -109,7 +112,8 @@ If you want to use a local version (need to clone and build from this repo):
109112
"command": "/path/to/your/node",
110113
"args": ["/path/to/mapbox-mcp-devkit/dist/esm/index.js"],
111114
"env": {
112-
"MAPBOX_ACCESS_TOKEN": "your_token_here"
115+
"MAPBOX_ACCESS_TOKEN": "your_token_here",
116+
"MCP_LOGGING_DISABLE": "true"
113117
}
114118
}
115119
}
@@ -180,6 +184,7 @@ Enable verbose error reporting by adding the environment variable:
180184
"args": ["-y", "@mapbox/mcp-devkit-server"],
181185
"env": {
182186
"MAPBOX_ACCESS_TOKEN": "your_token_here",
187+
"MCP_LOGGING_DISABLE": "true"
183188
"VERBOSE_ERRORS": "true"
184189
}
185190
}

docs/cursor-integration.md

Lines changed: 150 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,150 @@
1+
# Cursor Integration
2+
3+
This guide explains how to configure Cursor IDE for use with the Mapbox MCP DevKit Server.
4+
5+
## Requirements
6+
7+
- [Cursor](https://www.cursor.com/) installed
8+
- Mapbox MCP DevKit Server [built locally](../README.md#development-setup)
9+
10+
```sh
11+
# from repository root:
12+
# using node
13+
npm run build
14+
15+
# note your absolute path to node, you will need it for MCP config
16+
# For Mac/Linux
17+
which node
18+
# For Windows
19+
where node
20+
21+
# or alternatively, using docker
22+
docker build -t mapbox-mcp-devkit .
23+
```
24+
25+
## Setup Instructions
26+
27+
### Configure Cursor to use Mapbox MCP DevKit Server
28+
29+
1. Go to Cursor Settings/ MCP Tools and click on "Add Custom MCP".
30+
2. Add either of the following MCP config:
31+
- **NPM version** (recommended for simplicity)
32+
33+
```json
34+
{
35+
"mcpServers": {
36+
"MapboxDevKit": {
37+
"type": "stdio",
38+
"command": "<PATH_TO_YOUR_NPX>",
39+
"args": ["-y", "@mapbox/mcp-devkit-server"],
40+
"env": {
41+
"MAPBOX_ACCESS_TOKEN": "<YOUR_TOKEN>",
42+
"MCP_LOGGING_DISABLE": "true"
43+
}
44+
}
45+
}
46+
}
47+
```
48+
49+
- **Docker version** (recommended for isolation)
50+
51+
```json
52+
{
53+
"mcpServers": {
54+
"MapboxDevKit": {
55+
"type": "stdio",
56+
"command": "docker",
57+
"args": [
58+
"run",
59+
"-i",
60+
"--rm",
61+
"--env",
62+
"MAPBOX_ACCESS_TOKEN=<YOUR_TOKEN>",
63+
"--env",
64+
"MCP_LOGGING_DISABLE=true",
65+
"mapbox-mcp-devkit"
66+
]
67+
}
68+
}
69+
}
70+
```
71+
72+
- **Node version** (for local development)
73+
```json
74+
{
75+
"mcpServers": {
76+
"MapboxDevKit": {
77+
"type": "stdio",
78+
"command": "<PATH_TO_YOUR_NODE>",
79+
"args": ["/YOUR_PATH_TO_GIT_REPOSITORY/dist/esm/index.js"],
80+
"env": {
81+
"MAPBOX_ACCESS_TOKEN": "<YOUR_TOKEN>",
82+
"MCP_LOGGING_DISABLE": "true"
83+
}
84+
}
85+
}
86+
}
87+
```
88+
89+
3. Click "Save" to apply the configuration.
90+
91+
## Important Notes
92+
93+
### Stdio Transport Logging
94+
95+
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.
96+
97+
Both variable names are supported for backwards compatibility:
98+
99+
- `MCP_LOGGING_DISABLE` (recommended)
100+
- `MCP_DISABLE_LOGGING` (legacy)
101+
102+
### Token Scopes
103+
104+
Your Mapbox access token must have the appropriate scopes for the tools you want to use. See the [main README](../README.md#tools) for required token scopes per tool.
105+
106+
### Configuration Options
107+
108+
Additional environment variables you can set:
109+
110+
- `OTEL_EXPORTER_OTLP_ENDPOINT` - Enable OpenTelemetry tracing (see [tracing docs](./tracing.md))
111+
- `OTEL_SERVICE_NAME` - Override service name for tracing
112+
- `MAPBOX_API_ENDPOINT` - Override Mapbox API endpoint (advanced)
113+
114+
## Troubleshooting
115+
116+
### Server Not Appearing
117+
118+
If the Mapbox DevKit Server doesn't appear in Cursor's MCP tools:
119+
120+
1. Check that your `MAPBOX_ACCESS_TOKEN` is valid
121+
2. Verify the path to `node` or `npx` is correct
122+
3. For Docker: ensure the image is built with `docker images | grep mapbox-mcp-devkit`
123+
4. Check Cursor's logs for any error messages
124+
125+
### Connection Errors
126+
127+
If you see JSON-RPC or parsing errors:
128+
129+
1. Ensure `MCP_LOGGING_DISABLE` is set to `"true"` in your configuration
130+
2. If using Node version, verify the path to `dist/esm/index.js` is correct
131+
3. Run `npm run build` to ensure the latest build is available
132+
133+
### Tool Execution Failures
134+
135+
If tools fail to execute:
136+
137+
1. Verify your Mapbox token has the required scopes (see [README](../README.md))
138+
2. Check if you're hitting rate limits (429 errors)
139+
3. Enable verbose errors by adding `"VERBOSE_ERRORS": "true"` to the env config
140+
141+
## Example Usage
142+
143+
Once configured, you can use natural language to interact with Mapbox tools:
144+
145+
- "List all my Mapbox styles"
146+
- "Show me the bounding box for San Francisco"
147+
- "Convert these coordinates to lat/lng: -122.4194, 37.7749"
148+
- "Create a new Mapbox style called 'my-custom-map'"
149+
150+
See the [README](../README.md#example-prompts) for more example prompts.

0 commit comments

Comments
 (0)