From mapbox
Integration patterns for Mapbox MCP Server in AI applications. Covers runtime setup with pydantic-ai, mastra, LangChain, and custom agents for geospatial tasks.
How this skill is triggered — by the user, by Claude, or both
Slash command
/mapbox:mapbox-mcp-runtime-patternsThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
This skill provides patterns for integrating the Mapbox MCP Server into AI applications for production use with geospatial capabilities.
AGENTS.mdevals/evals.jsonexamples/README.mdexamples/python/crewai_example.pyexamples/python/pydantic_ai_example.pyexamples/python/requirements.txtexamples/python/smolagents_example.pyexamples/typescript/langchain-example.tsexamples/typescript/mastra-example.tsexamples/typescript/package-lock.jsonexamples/typescript/package.jsonexamples/typescript/tsconfig.jsonreferences/crewai.mdreferences/custom-agent.mdreferences/langchain.mdreferences/mastra.mdreferences/production.mdreferences/pydantic-ai.mdreferences/smolagents.mdreferences/use-cases.mdThis skill provides patterns for integrating the Mapbox MCP Server into AI applications for production use with geospatial capabilities.
The Mapbox MCP Server is a Model Context Protocol (MCP) server that provides AI agents with geospatial tools:
Offline Tools (Turf.js):
Mapbox API Tools:
Utility Tools:
Key benefit: Give your AI application geospatial superpowers without manually integrating multiple APIs.
Before integrating, understand the key distinctions between tools to help your LLM choose correctly:
Straight-line distance (offline, instant):
distance_tool, bearing_tool, midpoint_tooldistance_toolRoute distance (API, traffic-aware):
directions_tool, matrix_tooldirections_toolCategory/type search:
category_search_toolcategory_search_toolSpecific place/address:
search_and_geocode_tool, reverse_geocode_toolsearch_and_geocode_toolReachable area (what's within reach):
isochrone_toolisochrone_toolSpecific route (how to get there):
directions_tooldirections_toolOffline tools (free, instant):
distance_tool, point_in_polygon_tool, area_toolAPI tools (requires token, counts against usage):
directions_tool, category_search_tool, isochrone_toolBest practice: Prefer offline tools when possible, use API tools when you need real-time data or routing.
Easiest integration - Use Mapbox's hosted MCP server at:
https://mcp.mapbox.com/mcp
No installation required. Simply pass your Mapbox access token in the Authorization header.
Benefits:
Authentication:
Use token-based authentication (standard for programmatic access):
Authorization: Bearer your_mapbox_token
Note: The hosted server also supports OAuth, but that's primarily for interactive flows (coding assistants, not production apps).
For custom deployments or development:
npm install @mapbox/mcp-server
Or use directly via npx:
npx @mapbox/mcp-server
Environment setup:
export MAPBOX_ACCESS_TOKEN="your_token_here"
Detailed integration patterns and production guidance are organized into reference files. Load the ones relevant to your task.
Pydantic AI -- Type-safe Python agents
Load: references/pydantic-ai.md
CrewAI -- Multi-agent orchestration
Load: references/crewai.md
Smolagents -- Lightweight HuggingFace agents
Load: references/smolagents.md
Mastra -- Multi-agent TypeScript systems
Load: references/mastra.md
LangChain -- Conversational AI with tool chaining
Load: references/langchain.md
Custom Agent -- Zillow/TripAdvisor/DoorDash-style patterns, architecture diagrams, hybrid approach
Load: references/custom-agent.md
Use Cases -- Real Estate, Food Delivery, Travel Planning examples
Load: references/use-cases.md
Production Patterns -- Caching, batch operations, tool descriptions, error handling, security, rate limiting, testing
Load: references/production.md
Invoke this skill when:
npx claudepluginhub mapbox/mapbox-agent-skills --plugin mapboxIntegrates Mapbox MCP DevKit Server patterns for AI-assisted style management, token management, validation workflows, and documentation access in Mapbox development.
Automates Mapbox operations via Composio's Mapbox toolkit through Rube MCP. Discovers tools, manages connections, and executes workflows.
Integrates Amazon Location Service APIs for maps (MapLibre, static), geocoding, routing, places search, geofencing, and device tracking in AWS applications.