Introducing the Mapbox MCP Server: Location Intelligence for AI Agents

Published: (December 16, 2025 at 09:43 AM EST)
8 min read
Source: Dev.to

Source: Dev.to

Introduction

AI agents are getting smarter every day – they can write code, analyze data, and answer complex questions.
But when it comes to understanding where things are, most agents hit a wall. They can tell you about restaurants in San Francisco, but they can’t:

  • Geocode an address
  • Calculate a route
  • Determine if two locations are within walking distance

That’s where the Mapbox Model Context Protocol (MCP) Server comes in. It gives AI agents access to Mapbox’s powerful location services through a simple, standardized interface. No custom API integration is required – just connect your agent to the MCP server and it can instantly:

  • Geocode addresses
  • Plan routes
  • Analyze travel times
  • Create maps

Example

An AI agent built with MCP can naturally handle location queries and display results visually.

What Is the Model Context Protocol?

The Model Context Protocol is an open standard created by Anthropic for connecting AI models to external tools and data sources. Think of it as USB for AI agents – a universal connector that works across different frameworks and platforms.

Instead of writing custom code for each API, you:

  1. Connect your agent to an MCP server
  2. The server exposes its tools in a standardized format
  3. Your agent discovers and uses those tools automatically

MCP is supported by popular frameworks such as CrewAI, LangGraph, Pydantic AI, and Mastra, as well as AI assistants like GitHub Copilot and Claude Desktop.

Mapbox MCP Server – Geospatial Tools

The Mapbox MCP Server exposes nine powerful geospatial tools that give your agents comprehensive location intelligence.

ToolPurposeExample Use
search_and_geocode_toolConvert addresses/places to coordinates“Find coordinates for ‘1600 Pennsylvania Ave, Washington DC’
reverse_geocoding_toolConvert coordinates to addresses“What’s the address at 38.8977, ‑77.0365?”
directions_toolCalculate routes between points“Driving directions from Boston to New York with traffic”
matrix_toolTravel times between multiple points“Calculate delivery times from 3 warehouses to 10 addresses
isochrone_toolAreas reachable within time/distance“Show everywhere I can drive in 30 minutes from downtown”
static_image_toolGenerate map images“Create a map showing my delivery route”
category_search_toolFind POIs by category“Find all museums near Central Park
resource_reader_toolAccess reference data“Get list of available POI categories”
search_and_geocode_tool (Unified)Forward geocoding + POI search in one toolHandles “123 Main St”, “Starbucks near Times Square”, “Eiffel Tower”, etc.

Highlights

  • Traffic‑Aware Routingdirections_tool supports real‑time traffic, alternative routes, and multiple transportation modes (driving, walking, cycling).
  • Multi‑Point Optimizationmatrix_tool efficiently calculates travel times for dozens of locations – essential for logistics and service‑area analysis.
  • Reachability Analysisisochrone_tool generates polygons showing areas reachable within specific time or distance thresholds.
  • Visual Outputstatic_image_tool creates customizable map images with markers, routes, and overlays – perfect for reports or notifications.

Using the Mapbox MCP Server

You have two ways to use the server:

1. Hosted MCP Endpoint

Mapbox provides a hosted MCP endpoint that’s always available:

https://mcp.mapbox.com/mcp

Authentication

Client TypeMethod
Interactive (Claude Desktop, VS Code, etc.)OAuth flow with browser‑based login
Programmatic (agent frameworks)Bearer‑token authentication using your Mapbox access token

Setup – Interactive Tools

Add the following to your MCP settings (usually settings.json or a similar config file):

{
  "mcpServers": {
    "mapbox": {
      "url": "https://mcp.mapbox.com/mcp"
    }
  }
}

Claude Desktop config locations

OSPath
macOS~/Library/Application Support/Claude/claude_desktop_config.json
Windows%APPDATA%\Claude\claude_desktop_config.json

The first time you connect, a browser window will open asking you to log in to your Mapbox account and authorize access via OAuth.

Setup – Programmatic Access

  1. Create a Mapbox account (free tier) – Sign up here.
  2. Generate an access token from your account dashboard.

Use the token as a Bearer token in your code (see framework‑specific tutorials for examples).

Reference: Hosted MCP Server Guide – detailed setup for different clients.

Pros & Cons

ProsCons
No local setup or dependenciesAdditional network hop (your machine → hosted MCP → Mapbox APIs)
Managed infrastructure by MapboxRequires stable internet connection
Always available & automatically updatedLess control over configuration

2. Run MCP Server Locally

Running the server locally gives you full control – ideal for development, debugging, or customization.

Prerequisites

  • Node.js LTS+ (for npx method) or Python 3.10+ with uv (for uvx method)
  • A Mapbox account (free tier) – Sign up here
  • Your Mapbox access token

Setup – Interactive Tools

Add the following to your MCP settings:

{
  "mcpServers": {
    "mapbox": {
      "command": "npx",
      "args": ["-y", "@mapbox/mcp-server"],
      "env": {
        "MAPBOX_ACCESS_TOKEN": "your_token_here"
      }
    }
  }
}

Claude Desktop config locations

OSPath
macOS~/Library/Application Support/Claude/claude_desktop_config.json
Windows%APPDATA%\Claude\claude_desktop_config.json

Running the Server (Node)

npx -y @mapbox/mcp-server

Running the Server (Python/uv)

uvx @mapbox/mcp-server

Pros & Cons

ProsCons
Full control over configuration and dependenciesRequires local installation and maintenance
No extra network hop – direct calls to Mapbox APIsMust keep the server running and updated
Ideal for offline or highly customized environmentsSlightly higher setup effort

Note on the DevKit MCP Server

Mapbox also offers the DevKit MCP Server (hosted at https://mcp-devkit.mapbox.com/mcp). It is designed to help developers build Mapbox applications by providing:

  • Code examples
  • Documentation search
  • Development assistance

This post focuses on the main MCP server for location intelligence. The DevKit will be covered in a future post.

Quick‑Start Guide

Configuration File

PlatformPath
Claude Desktoport/Claude/claude_desktop_config.json
Windows%APPDATA%\Claude\claude_desktop_config.json

Running the Server (Command‑Line)

  1. Set your Mapbox access token

    export MAPBOX_ACCESS_TOKEN="your_token_here"
  2. Start the server

    Node.js (recommended)

    npx -y @mapbox/mcp-server

    Python (via uvx)

    pip install uv          # if you don’t have uv yet
    uvx mapbox-mcp
  3. Test with MCP Inspector

    npx @modelcontextprotocol/inspector npx -y @mapbox/mcp-server

    A web UI opens, letting you explore the exposed tools and try them interactively.

Sample Natural‑Language Requests

The agent will automatically discover the right tools, call them, and return a concise answer (no manual API handling required).

RequestWhat the agent does
“Find coffee shops within walking distance of the Empire State Building.”Geocode the Empire State Building → Search for coffee shops → Return list
“Show me gas stations along the route from Boston to New York.”Geocode both cities → Get driving directions → Search for gas stations along the polyline
“What restaurants are near Times Square?”Geocode Times Square → Search for restaurants → Return results
“Get driving directions from LAX to Hollywood with current traffic.”Geocode LAX & Hollywood → Directions (traffic aware) → Return route
“How long would it take to walk from Central Park to Times Square?”Geocode both locations → Walking directions → Return duration
“Calculate travel time from my hotel (Four Seasons) to JFK Airport by taxi.”Geocode hotel & airport → Taxi profile directions → Return duration
“What’s the fastest route visiting Salesforce Tower, Twitter HQ, and Uber headquarters?”Geocode three locations → Optimize order → Directions → Return route
“Create a map image showing the route from Golden Gate Bridge to Fisherman’s Wharf.”Directions → Static map generation → Return image URL
“Show me a satellite view of Manhattan with key landmarks marked.”Static map (satellite) + markers → Return image
“Generate a map highlighting all Starbucks locations within a mile of downtown Seattle.”Search → Filter by distance → Static map with markers
“Show me areas reachable within 30 minutes of downtown Portland by car.”Isochrone generation → Return polygon
“Calculate a travel‑time matrix between 3 hotel locations and the convention center.”Matrix API → Return matrix
“Find the optimal route visiting 3 tourist attractions in San Francisco.”Geocode → Optimize → Directions
“I’m staying at the Fairmont. Show me everywhere I can reach by walking in 15 minutes.”Geocode → Isochrone (walking) → Return polygon
“How long does it take to drive from the Space Needle to Pike Place Market?”1. search_and_geocode_tool → Space Needle 2. search_and_geocode_tool → Pike Place Market 3. directions_tool (driving) → Returns ≈ 8 minutes, 1.2 mi

Compatibility – MCP‑Ready Clients

Framework / ToolLanguageTypical Use
CrewAIPythonMulti‑agent collaboration
LangGraphPythonStateful agent workflows
Pydantic AIPythonType‑safe agent development
MastraTypeScriptProduction AI applications
SmolagentsPythonLightweight agents (🤗 Hub)
Claude DesktopAnthropic’s AI assistant
ChatGPTOpenAI desktop app
Gemini CLIGoogle’s command‑line tool
VS CodeMCP extensions
CursorAI‑powered IDE
GooseTerminal‑based AI assistant

All follow the same basic flow:

  1. Configure the MCP server connection.
  2. Add the configuration to your agent.
  3. The agent discovers available tools automatically.
  4. Use natural language to invoke tools.

Detailed tutorials for each framework are coming soon.

Why Use MCP Instead of a Custom API Integration?

Traditional ApproachMCP Approach
Write geocoding logic, format coordinates, handle errors, chain calls manually.Describe the goal in plain language; the agent handles everything.
Manual tool discovery & configuration.Automatic tool discovery via standardized MCP schema.
Framework‑specific code.Write once, run everywhere (framework‑agnostic).
Hard‑coded tool chaining.Intelligent, dynamic tool chaining based on task dependencies.

Real‑World Use Cases

  • Hotel concierge bots (directions, local recommendations)
  • Trip‑planning assistants (multi‑stop itinerary optimization)
  • Event coordinators (travel‑time calculations for attendees)
  • Delivery‑fleet route optimization
  • Service‑area analysis for expansion planning
  • Warehouse location analysis (customer distribution)
  • Commute‑time calculators for real‑estate listings
  • School‑district & amenity proximity analysis
  • Neighborhood boundary visualizations
  • Technician dispatch optimization
  • Emergency‑response time calculations
  • Store locators with accurate directions
  • Coverage‑area mapping for service offerings
  • Competitive location analysis

Resources

  • Mapbox MCP ServerGitHub (source & docs)
  • Hosted MCP Server Guide – Setup for different clients
  • Model Context Protocol (MCP) Spec – Standard documentation
  • Mapbox API Docs – Underlying API reference
  • Supportmcp-feedback@mapbox.com
  • IssuesGitHub Issues
  • Community – Join discussions in the MCP community

Pricing (Standard Mapbox API Rates)

ServiceFree Tier
Geocoding100 k requests / month
Directions5 k requests / month
MatrixCounts as origins × destinations requests
Static Maps50 k requests / month

The free tier is generous for development and small projects. For production, review the full Mapbox pricing page.

Get Started

  1. Sign up for Mapbox – Get a free access token at the sign‑up page.
  2. Run the server (see “Running the Server” above).
  3. Try the MCP Inspector to explore tools.
  4. Pick a framework and start building location‑aware AI agents!

Happy mapping! 🚀

Getting Started

  • Start with CrewAI, LangGraph, or your preferred agent framework.
  • Build something: Check out our framework‑specific tutorials (coming soon!).

What’s Next

  • In our next post, we’ll dive deep into building a multi‑agent travel planning system with CrewAI and Mapbox MCP, complete with working code you can run and customize.

Coming Soon

  • A guide to the Mapbox DevKit MCP Server, which helps AI assistants write Mapbox code by providing documentation, examples, and API guidance—perfect for developers building Mapbox applications.

Get In Touch

  • Have questions or want to share what you’re building? Reach out to mcp-feedback@mapbox.com or open an issue on GitHub.
Back to Blog

Related posts

Read more »