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.

referencesdesign-patterns.md

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

Design Patterns

Pattern 1: Iterative Style Development

Workflow:

  1. Describe desired style in natural language
  2. AI creates initial style via MCP
  3. View preview URL
  4. Request adjustments
  5. AI updates style via MCP
  6. Repeat until satisfied

Example conversation:

You: "Create a style for a real estate app - emphasize property boundaries,
     show parks prominently, muted roads"

AI: [Creates style, returns ID and preview URL]

You: "Make the property boundaries purple and thicker"

AI: [Updates style]

You: "Perfect! Now add POI icons for schools and transit"

AI: [Updates style with symbols]

Benefits:

  • No manual JSON editing
  • Visual feedback via preview URLs
  • Rapid iteration

Pattern 2: Environment-Specific Tokens

Workflow:

  1. Define requirements per environment
  2. AI creates tokens with appropriate scopes/restrictions
  3. Store securely in environment variables

Example:

You: "Create three tokens:
1. Development - all scopes, localhost only
2. Staging - read-only scopes, staging.example.com
3. Production - minimal scopes, example.com only"

AI: [Creates three tokens with specified configurations]

Benefits:

  • Least-privilege access
  • Domain restrictions prevent token misuse
  • Clear separation of concerns

Pattern 3: Validation-First Development

Workflow:

  1. Design data structure
  2. Validate GeoJSON before using
  3. Validate expressions before adding to style
  4. Catch errors early

Example:

You: "I have GeoJSON with restaurant locations. Validate it and check for
     any missing required properties"

AI: [Validates, reports any issues]

You: "Now create a style that displays these restaurants with icons sized
     by rating. Validate the expression first."

AI: [Validates expression, then creates style]

Benefits:

  • Catch errors before deployment
  • Ensure data integrity
  • Faster debugging

Pattern 4: Documentation-Driven Development

Workflow:

  1. Ask about Mapbox capabilities
  2. Get authoritative documentation
  3. Implement with correct patterns
  4. Validate implementation

Example:

You: "How do I create a choropleth map in Mapbox GL JS?"

AI: [Retrieves docs, provides pattern]

You: "Create a style with that pattern for population density data"

AI: [Creates style following documented pattern]

Benefits:

  • Always use latest best practices
  • No outdated Stack Overflow answers
  • Official Mapbox guidance

Integration with Existing Tools

With Mapbox Studio

DevKit complements, doesn't replace Studio:

  • DevKit: Quick iterations, automated workflows, AI assistance
  • Studio: Visual editing, fine-tuning, team collaboration

Pattern: Use DevKit for initial creation, Studio for refinement.

With Mapbox APIs

DevKit wraps Mapbox APIs but doesn't replace them:

  • DevKit: Development-time operations via AI
  • APIs: Production runtime operations

Pattern: Use DevKit during development, APIs in production code.

With Version Control

Pattern: Save generated styles to git for review and rollback.

You: "Create a new style for the home page map and save the JSON to
     styles/home-map.json"

AI: [Creates style, writes JSON to file]

You: [Review, commit to git]

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.