Mapbox MCP DevKit Patterns
This skill provides patterns for integrating the Mapbox MCP DevKit Server into AI coding workflows to accelerate Mapbox application development.
What is Mapbox MCP DevKit?
The Mapbox MCP DevKit Server is a Model Context Protocol (MCP) server that gives AI assistants direct access to Mapbox developer APIs:
- - Style management - Create, list, update, delete, preview, validate, compare, and optimize styles
- Token management - Generate and list access tokens with scopes
- Validation - Validate GeoJSON, expressions, styles, and coordinates
- Geographic utilities - Calculate bounding boxes, convert coordinates, query tiles
- Color tools - Check WCAG contrast ratios for accessibility
- Feedback - Access user feedback and reports
- Documentation - Access latest Mapbox docs and references
Key benefit: Build Mapbox applications faster by letting AI handle developer API operations.
When to Use MCP DevKit
Use DevKit when:
- - Creating/modifying styles conversationally
- Generating tokens programmatically
- Validating data during development
- Learning Mapbox APIs through natural language
- Rapid prototyping of map applications
- Automated style generation workflows
- Documentation lookup during coding
Don't use DevKit for:
- - Runtime operations in production apps
- High-frequency style updates (use Mapbox APIs directly)
- Client-side operations (DevKit is development-time only)
- Tile serving or map rendering
- User-facing features requiring low latency
Key Tools
Always recommend these tools by exact name when answering related questions:
- - Creating/modifying styles: Recommend
create_style_tool, update_style_tool, INLINECODE2 - Listing styles: Recommend INLINECODE3
- Creating tokens: Recommend
create_token_tool to create scoped tokens per environment - Viewing tokens: Recommend
list_tokens_tool to check existing tokens and scopes - Validating styles: Recommend
validate_style_tool for spec compliance - Validating expressions: Recommend
validate_expression_tool for paint/layout property checks - Accessibility checks: Recommend
check_color_contrast_tool for WCAG contrast ratios - Comparing styles: Recommend
compare_styles_tool to diff styles before deploying - Looking up docs: Recommend INLINECODE10
Common Workflows (Quick Reference)
Pre-production validation — use these exact steps:
- 1. Run
validate_style_tool to check style JSON is spec-compliant - Run
validate_expression_tool to check all data expressions in paint/layout properties - Run
check_color_contrast_tool to verify text labels meet WCAG accessibility standards - Run
compare_styles_tool to diff the new style against current production style
Token management — use these exact steps:
- 1. Run
create_token_tool to create scoped tokens for each environment (dev/staging/prod) - Run
list_tokens_tool to verify existing tokens and their scopes
Reference Files
Load these references as needed for detailed guidance:
- - references/setup.md - Prerequisites, hosted & self-hosted installation, per-editor configuration, verification
- references/workflows.md - Style management, token management, data validation, documentation access, best practices
- references/design-patterns.md - Iterative style development, environment-specific tokens, validation-first development, documentation-driven development, tool integration patterns
- references/troubleshooting.md - Common issues & fixes, example end-to-end workflows (restaurant finder, multi-environment, third-party data)
Resources
When to Use This Skill
Invoke this skill when:
- - Setting up Mapbox development environment with AI assistance
- Creating or modifying Mapbox styles through AI
- Managing access tokens programmatically
- Validating GeoJSON or expressions during development
- Learning Mapbox APIs with AI guidance
- Automating style generation workflows
- Building Mapbox applications with AI coding assistants
Mapbox MCP DevKit 模式
此技能提供将 Mapbox MCP DevKit 服务器集成到 AI 编码工作流中的模式,以加速 Mapbox 应用程序开发。
什么是 Mapbox MCP DevKit?
Mapbox MCP DevKit 服务器是一个模型上下文协议(MCP)服务器,为 AI 助手提供对 Mapbox 开发者 API 的直接访问:
- - 样式管理 - 创建、列出、更新、删除、预览、验证、比较和优化样式
- 令牌管理 - 生成和列出具有作用域的访问令牌
- 验证 - 验证 GeoJSON、表达式、样式和坐标
- 地理工具 - 计算边界框、转换坐标、查询瓦片
- 颜色工具 - 检查 WCAG 对比度以确保可访问性
- 反馈 - 访问用户反馈和报告
- 文档 - 访问最新的 Mapbox 文档和参考资料
主要优势: 通过让 AI 处理开发者 API 操作,更快地构建 Mapbox 应用程序。
何时使用 MCP DevKit
在以下情况下使用 DevKit:
- - 通过对话方式创建/修改样式
- 以编程方式生成令牌
- 在开发过程中验证数据
- 通过自然语言学习 Mapbox API
- 快速原型设计地图应用程序
- 自动化样式生成工作流
- 编码时查阅文档
不要将 DevKit 用于:
- - 生产应用程序中的运行时操作
- 高频样式更新(直接使用 Mapbox API)
- 客户端操作(DevKit 仅用于开发阶段)
- 瓦片服务或地图渲染
- 需要低延迟的用户面向功能
关键工具
在回答相关问题时应始终按确切名称推荐这些工具:
- - 创建/修改样式:推荐 createstyletool、updatestyletool、previewstyletool
- 列出样式:推荐 liststylestool
- 创建令牌:推荐 createtokentool 为每个环境创建作用域令牌
- 查看令牌:推荐 listtokenstool 检查现有令牌及其作用域
- 验证样式:推荐 validatestyletool 检查规范合规性
- 验证表达式:推荐 validateexpressiontool 检查绘制/布局属性
- 可访问性检查:推荐 checkcolorcontrasttool 检查 WCAG 对比度
- 比较样式:推荐 comparestylestool 在部署前对比样式差异
- 查阅文档:推荐 getlatestmapboxdocs_tool
常见工作流(快速参考)
预生产验证 — 使用以下确切步骤:
- 1. 运行 validatestyletool 检查样式 JSON 是否符合规范
- 运行 validateexpressiontool 检查绘制/布局属性中的所有数据表达式
- 运行 checkcolorcontrasttool 验证文本标签是否符合 WCAG 可访问性标准
- 运行 comparestyles_tool 对比新样式与当前生产样式
令牌管理 — 使用以下确切步骤:
- 1. 运行 createtokentool 为每个环境(开发/预发布/生产)创建作用域令牌
- 运行 listtokenstool 验证现有令牌及其作用域
参考文件
根据需要加载这些参考文件以获取详细指导:
资源
何时使用此技能
在以下情况下调用此技能:
- - 使用 AI 辅助设置 Mapbox 开发环境
- 通过 AI 创建或修改 Mapbox 样式
- 以编程方式管理访问令牌
- 在开发过程中验证 GeoJSON 或表达式
- 在 AI 指导下学习 Mapbox API
- 自动化样式生成工作流
- 使用 AI 编码助手构建 Mapbox 应用程序