All skills
mapbox avatar

/mapbox-mcp-devkit-patterns

@65bab68 official
by mapboxmapbox/mapbox-agent-skills80 stars
17

Integration patterns for Mapbox MCP DevKit Server in AI coding assistants. Covers setup, style management, token management, validation workflows, and documentation access through MCP. Use when building Mapbox applications with AI coding assistance.

Use this Skill: https://skilld.dev/gh/mapbox/mapbox-agent-skills/mapbox-mcp-devkit-patterns

This session only. Nothing lands on disk.

referencesworkflows.md

≈682 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Core Workflows

1. Style Management

Create a style conversationally:

"Create a dark mode Mapbox style with 3D buildings, emphasize parks in green,
and use blue for water. Name it 'app-dark-mode'."

The AI will use create_style_tool tool to:

  • Generate style JSON following Mapbox Style Spec
  • Upload to your Mapbox account
  • Return style ID and preview URL

Update existing style:

"Update style mapbox://styles/username/style-id to make roads more prominent
and reduce building opacity to 0.6"

Validate style:

"Validate this style JSON: [paste style]"

2. Token Management

Create scoped token:

"Create a Mapbox token with these scopes:
- styles:read
- fonts:read
- datasets:read
Restrict it to domains: localhost, example.com"

List existing tokens:

"Show me all my Mapbox tokens and their scopes"

Use case: Generate tokens for different environments (development, staging, production) with appropriate restrictions.

3. Data Validation

Validate GeoJSON:

"Validate this GeoJSON and show any errors:
{
  \"type\": \"FeatureCollection\",
  \"features\": [...]
}"

Validate expressions:

"Is this a valid Mapbox expression?
['case', ['<', ['get', 'population'], 1000], 'small', 'large']"

Coordinate conversion:

"Convert longitude -122.4194, latitude 37.7749 from WGS84 to Web Mercator"

4. Documentation Access

Get style spec info:

"What properties are available for fill layers in Mapbox GL JS?"

Check token scopes:

"What token scopes do I need to use the Directions API?"

Streets v8 fields:

"What fields are available in the 'road' layer of Streets v8?"

Best Practices

Security

  • Never commit access tokens - Use environment variables
  • Use scoped tokens - Minimal necessary permissions
  • Add URL restrictions - Limit to your domains
  • Rotate tokens regularly - Generate new tokens periodically

Style Management

  • Version your styles - Save JSON to source control
  • Use meaningful names - prod-light-mode not style-123
  • Document decisions - Add comments explaining style choices
  • Preview before deploying - Always check preview URL

Validation

  • Validate early - Check data before creating styles
  • Use strict validation - Don't skip validation steps
  • Test expressions - Validate before adding to styles
  • Verify coordinates - Ensure correct format and bounds

Documentation

  • Ask specific questions - "What are fill-extrusion properties?"
  • Reference versions - Specify GL JS version if relevant
  • Cross-reference - Validate AI responses against official docs

Source: SKILL.md on GitHub

1 warning17d5 checks · Risk SAFE
  • Gen Agent Trust Hub17d

    The skill provides patterns and documentation for the Mapbox MCP DevKit, a toolset for Mapbox development. It follows security best practices for API token management and uses official Mapbox resources. The skill is assessed as low risk because it processes external data such as GeoJSON and style JSON, which represents a standard surface for indirect prompt injection attacks.

  • Socket17d

    No alerts

  • Snyk17d

    Risk: LOW · No issues

  • Runlayer6mo

    2/2 files flagged

  • ZeroLeaks5mo

    Score: 93/100 · 2 sections analyzed

Signed by skilld at 65bab68. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 9 hours ago.

Activeupdated 6 months ago
  • MCP
  • mapbox
  • style-management
  • token-management
  • validation
  • geojson
  • geojs
  • ai-coding

README badge

README badge for mapbox/mapbox-agent-skills/mapbox-mcp-devkit-patterns

Provides integration patterns for the Mapbox MCP DevKit Server, enabling AI assistants to manage styles, tokens, and validate data through Model Context Protocol. Use this skill when building Mapbox applications with AI assistance to handle style creation, token generation, GeoJSON validation, and documentation lookup.

Generated from the current SKILL.md.

What is the Mapbox MCP DevKit Server?
It's a Model Context Protocol (MCP) server that gives AI assistants direct access to Mapbox developer APIs for style management, token generation, validation, geographic utilities, and documentation lookup during development.
Can I use this skill for runtime operations in production applications?
No. The DevKit is development-time only and should not be used for runtime operations, high-frequency updates, client-side operations, or user-facing features requiring low latency.
What validation tools does this skill provide?
The skill includes `validate_style_tool` for style JSON spec compliance, `validate_expression_tool` for paint/layout property checks, and `check_color_contrast_tool` for WCAG accessibility verification.
How do I manage access tokens with this skill?
Use `create_token_tool` to generate scoped tokens per environment (dev/staging/prod) and `list_tokens_tool` to view existing tokens and their scopes.

Generated from the current SKILL.md. These answers refresh after source changes.