Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ MAPBOX_ACCESS_TOKEN=your-mapbox-token-here

# Disable console logging (recommended when using stdio transport)
# Uncomment to enable:
# MCP_DISABLE_LOGGING=true
# MCP_LOGGING_DISABLE=true

# =============================================================================
# OpenTelemetry Tracing (Optional)
Expand All @@ -39,6 +39,11 @@ OTEL_RESOURCE_ATTRIBUTES=service.name=mapbox-mcp-devkit-server,service.version=0
# ⚠️ Do NOT enable with stdio transport - it breaks JSON-RPC communication
# OTEL_EXPORTER_CONSOLE_ENABLED=true

# Optional: OTEL diagnostic log level (default: NONE to avoid stdio pollution)
# Set to DEBUG, INFO, WARN, or ERROR for troubleshooting OTEL issues
# ⚠️ Only use for debugging - logs will corrupt stdio transport
# OTEL_LOG_LEVEL=ERROR

# Optional: OTLP authentication headers (for production backends)
# OTEL_EXPORTER_OTLP_HEADERS={"Authorization": "Bearer your-token"}

Expand Down
1 change: 1 addition & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ This server includes OpenTelemetry (OTEL) instrumentation for distributed tracin
- `OTEL_TRACING_ENABLED` — Set to `false` to explicitly disable tracing even if endpoint is configured
- `OTEL_SERVICE_NAME` — Override service name (default: `mapbox-mcp-devkit-server`)
- `OTEL_EXPORTER_OTLP_HEADERS` — JSON string of additional headers for OTLP exporter
- `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.

### What Gets Traced

Expand Down
20 changes: 12 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,20 @@ https://github.com/user-attachments/assets/8b1b8ef2-9fba-4951-bc9a-beaed4f6aff6
- [Coordinate Conversion tool](#coordinate-conversion-tool)
- [Bounding Box tool](#bounding-box-tool)
- [Resources](#resources)
- [Observability & Tracing](#observability--tracing)
- [Observability \& Tracing](#observability--tracing)
- [Features](#features)
- [Quick Start with Jaeger](#quick-start-with-jaeger)
- [Supported Backends](#supported-backends)
- [Documentation](#documentation)
- [Environment Variables](#environment-variables)
- [Development](#development)
- [Testing](#testing)
- [Tool Snapshot Tests](#tool-snapshot-tests)
- [Inspecting Server](#inspecting-server)
- [Using Node.js](#using-nodejs)
- [Using Docker](#using-docker)
- [Creating New Tools](#creating-new-tools)
- [Environment Variables](#environment-variables)
- [Environment Variables](#environment-variables-1)
- [VERBOSE_ERRORS](#verbose_errors)
- [Troubleshooting](#troubleshooting)
- [Contributing](#contributing)
Expand All @@ -48,6 +53,8 @@ Get started by integrating with your preferred AI development environment:

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

### DXT Package Distribution

Expand Down Expand Up @@ -592,11 +599,8 @@ npm test -- --updateSnapshot
#### Using Node.js

```sh
# Build
npm run build

# Inspect
npx @modelcontextprotocol/inspector node dist/esm/index.js
# Run the built image
npm run inspect:build
```

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

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

### Creating New Tools
Expand Down
9 changes: 7 additions & 2 deletions docs/claude-code-integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ Add to your Claude Code MCP configuration:
"command": "npx",
"args": ["-y", "@mapbox/mcp-devkit-server"],
"env": {
"MAPBOX_ACCESS_TOKEN": "your_token_here"
"MAPBOX_ACCESS_TOKEN": "your_token_here",
"MCP_LOGGING_DISABLE": "true"
Comment thread
mattpodwysocki marked this conversation as resolved.
Outdated
}
}
}
Expand All @@ -80,6 +81,8 @@ Add to your Claude Code MCP configuration:
"--rm",
"-e",
"MAPBOX_ACCESS_TOKEN=your_token_here",
"-e",
"MCP_LOGGING_DISABLE": "true",
"mapbox-mcp-devkit"
]
}
Expand All @@ -98,7 +101,8 @@ If you want to use a local version (need to clone and build from this repo):
"command": "/path/to/your/node",
"args": ["/path/to/mapbox-mcp-devkit/dist/esm/index.js"],
"env": {
"MAPBOX_ACCESS_TOKEN": "your_token_here"
"MAPBOX_ACCESS_TOKEN": "your_token_here",
"MCP_LOGGING_DISABLE": "true"
}
}
}
Expand Down Expand Up @@ -196,6 +200,7 @@ Enable verbose error reporting by adding the environment variable:
"args": ["-y", "@mapbox/mcp-devkit-server"],
"env": {
"MAPBOX_ACCESS_TOKEN": "your_token_here",
"MCP_LOGGING_DISABLE": "true",
"VERBOSE_ERRORS": "true"
}
}
Expand Down
9 changes: 7 additions & 2 deletions docs/claude-desktop-integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ For users who prefer manual configuration or need custom setups, you can configu
"command": "npx",
"args": ["-y", "@mapbox/mcp-devkit-server"],
"env": {
"MAPBOX_ACCESS_TOKEN": "your_token_here"
"MAPBOX_ACCESS_TOKEN": "your_token_here",
"MCP_LOGGING_DISABLE": "true"
}
}
}
Expand All @@ -91,6 +92,8 @@ For users who prefer manual configuration or need custom setups, you can configu
"--rm",
"-e",
"MAPBOX_ACCESS_TOKEN=your_token_here",
"-e",
"MCP_LOGGING_DISABLE": "true",
"mapbox-mcp-devkit"
]
}
Expand All @@ -109,7 +112,8 @@ If you want to use a local version (need to clone and build from this repo):
"command": "/path/to/your/node",
"args": ["/path/to/mapbox-mcp-devkit/dist/esm/index.js"],
"env": {
"MAPBOX_ACCESS_TOKEN": "your_token_here"
"MAPBOX_ACCESS_TOKEN": "your_token_here",
"MCP_LOGGING_DISABLE": "true"
}
}
}
Expand Down Expand Up @@ -180,6 +184,7 @@ Enable verbose error reporting by adding the environment variable:
"args": ["-y", "@mapbox/mcp-devkit-server"],
"env": {
"MAPBOX_ACCESS_TOKEN": "your_token_here",
"MCP_LOGGING_DISABLE": "true"
"VERBOSE_ERRORS": "true"
}
}
Expand Down
167 changes: 167 additions & 0 deletions docs/cursor-integration.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,167 @@
# Cursor Integration

This guide explains how to configure Cursor IDE for use with the Mapbox MCP DevKit Server.

## Requirements

- [Cursor](https://www.cursor.com/) installed
- Mapbox MCP DevKit Server [built locally](../README.md#development-setup)

```sh
# from repository root:
# using node
npm run build

# or alternatively, using docker
docker build -t mapbox-mcp-devkit .
```

## Setup Instructions

### Configure Cursor to use Mapbox MCP DevKit Server

1. Go to Cursor Settings/ MCP Tools and click on "Add Custom MCP".
2. Add either of the following MCP config:
- **NPM version** (recommended for simplicity)

```json
{
"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)

```json
{
"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)
```json
{
"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"
}
}
}
}
```

3. Click "Save" to apply the configuration.

## Important Notes

### Stdio Transport Logging

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.

### Token Scopes

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.

### Configuration Options

Additional environment variables you can set:

- `OTEL_EXPORTER_OTLP_ENDPOINT` - Enable OpenTelemetry tracing (see [tracing docs](./tracing.md))
- `OTEL_SERVICE_NAME` - Override service name for tracing
- `MAPBOX_API_ENDPOINT` - Override Mapbox API endpoint (advanced)

## Troubleshooting

### Server Not Appearing

If the Mapbox DevKit Server doesn't appear in Cursor's MCP tools:

1. Check that your `MAPBOX_ACCESS_TOKEN` is valid
2. Verify `node` and `npx` are in your PATH (run `which node` or `which npx`)
3. For Docker: ensure the image is built with `docker images | grep mapbox-mcp-devkit`
4. Check Cursor's logs for any error messages

### Command Not Found

If you get "command not found" errors for `node` or `npx`:

1. Find the absolute path:

```bash
# Mac/Linux
which node
which npx

# Windows
where node
where npx
```

2. Use the absolute path in your config:
```json
{
"mcpServers": {
"MapboxDevKit": {
"command": "/usr/local/bin/npx", // Use your actual path
...
}
}
}
```

### Connection Errors

If you see JSON-RPC or parsing errors:

1. Ensure `MCP_LOGGING_DISABLE` is set to `"true"` in your configuration
2. If using Node version, verify the path to `dist/esm/index.js` is correct
3. Run `npm run build` to ensure the latest build is available

### Tool Execution Failures

If tools fail to execute:

1. Verify your Mapbox token has the required scopes (see [README](../README.md))
2. Check if you're hitting rate limits (429 errors)
3. Enable verbose errors by adding `"VERBOSE_ERRORS": "true"` to the env config

## Example Usage

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](../README.md#example-prompts) for more example prompts.
Loading
Loading