Mapbox MCP for AI Agents

Securely connect your AI agents and chatbots (Claude, ChatGPT, Cursor, etc) with Mapbox MCP or direct API to search locations, generate maps, calculate routes, and analyze geospatial data through natural language.

Mapbox logoMapbox
Api Key

Mapbox is a platform providing powerful maps, navigation, and location services for developers. Integrate Mapbox for dynamic, interactive mapping and geospatial insights in your apps.

32 Tools

Try Mapbox now

Type what you want done — sign in and watch it run live in the Tool Router playground.

TOOL ROUTER PLAYGROUND
Mapbox
Try asking
TOOLS

Supported Tools

Every Mapbox action and event your agent gets out of the box.

Batch Geocode V6

Tool to perform batch geocoding with up to 1000 queries in a single request.

Forward Geocode V5

Tool to search for places by name or address using Mapbox Geocoding v5 API (forward geocoding).

Batch Geocoding

Tool to perform batch forward or reverse geocoding for multiple locations.

Forward Geocoding

Tool to convert free-form or structured address into geographic coordinates and place features.

Permanent Forward Geocoding

Tool to perform permanent forward geocoding.

Permanent Reverse Geocoding

Tool to perform permanent reverse geocoding.

Reverse Geocoding

Tool to reverse geocode coordinates into place names.

Get Access Token

Tool to extract and validate Mapbox access token from connection metadata.

Get Isochrone

Tool to calculate areas reachable within a specified amount of time or distance from a location.

Get Map Matching

Tool to snap fuzzy GPS traces to roads on the road network.

Get Optimization V1

Tool to calculate optimal driving routes and trips that visit a set of waypoints.

Get Sprite

Tool to retrieve a sprite image or its JSON document from a Mapbox style.

Get Static Image

Request a static map image from a Mapbox Studio style.

Get Static Tiles

Tool to retrieve raster tiles from a Mapbox Studio style.

Get Token Information

Tool to retrieve information about a Mapbox access token and validate its status.

Get Vector Tiles

Tool to retrieve vector tiles from Mapbox-hosted vector tilesets.

Map Matching (POST)

Tool to snap GPS coordinates to the road network using POST method for longer coordinate lists.

Query Tile Features

Tool to retrieve data about specific features from vector tilesets based on a location.

Request Style Embed HTML

Retrieve embeddable HTML for a Mapbox style that can be embedded in an iframe.

Retrieve Directions

Tool to retrieve directions between waypoints.

Retrieve Font Glyph Ranges

Tool to retrieve font glyph ranges as PBF tiles.

Retrieve Marker

Tool to retrieve a standalone marker image without any background map.

Retrieve Matrix

Retrieve a travel time and distance matrix between multiple locations.

Retrieve Searchbox Place Details

Tool to retrieve full details for a specific place by its Mapbox ID.

Retrieve Style

Retrieves the complete Mapbox style specification as JSON, including all layers, sources, sprites, and configuration.

Retrieve Style WMTS

Retrieve a WMTS (Web Map Tile Service) capabilities document for a Mapbox style.

Retrieve Tileset Metadata

Tool to retrieve metadata for a Mapbox tileset.

Reverse Geocoding V6

Tool to convert geographic coordinates to place names using Geocoding v6 API.

Search Box Reverse Geocoding

Tool to convert coordinates to places using the Search Box API (reverse geocoding).

Search Box Forward

Tool to search for places by name or address using the Search Box API.

Search by Category

Tool to search for places by category (e.

Search Box Suggest

Tool to get autocomplete suggestions for a partial search query.

SETUP GUIDE

Connect Mapbox MCP Tool with your Agent

1

Install Composio

typescript
npm install @composio/core ai @ai-sdk/openai @ai-sdk/mcp
Install the Composio SDK and Claude Agent SDK
2

Create Tool Router Session

typescript
import { Composio } from '@composio/core';

const composio = new Composio({ apiKey: 'your-api-key' });

console.log("Creating Tool Router session...");
const { mcp } = await composio.create('your-user-id');
console.log(`Tool Router session created: ${mcp.url}`);
Initialize the Composio client and create a Tool Router session
3

Connect to AI Agent

typescript
import { openai } from '@ai-sdk/openai';
import { experimental_createMCPClient as createMCPClient } from '@ai-sdk/mcp';
import { generateText, stepCountIs } from 'ai';

const client = await createMCPClient({
  transport: {
    type: 'http',
    url: mcp.url,
    headers: { 'x-api-key': 'your-composio-api-key' }
  }
});

const tools = await client.tools();

const { text } = await generateText({
  model: openai('gpt-4o'),
  tools,
  messages: [{ role: 'user', content: 'Get driving directions from Times Square to Central Park in New York City' }],
  stopWhen: stepCountIs( 5 )
});

console.log(`Agent: ${text}`);
Use the MCP server with your AI agent
SETUP GUIDE

Connect Mapbox API Tool with your Agent

1

Install Composio

typescript
npm install @composio/openai
Install the Composio SDK
2

Initialize Composio and Create Tool Router Session

typescript
import OpenAI from 'openai';
import { Composio } from '@composio/core';
import { OpenAIResponsesProvider } from '@composio/openai';

const composio = new Composio({
  provider: new OpenAIResponsesProvider(),
});
const openai = new OpenAI({});
const session = await composio.create('your-user-id');
Import and initialize Composio client, then create a Tool Router session
3

Execute Mapbox Tools via Tool Router with Your Agent

typescript
const tools = session.tools;
const response = await openai.responses.create({
  model: 'gpt-4.1',
  tools: tools,
  input: [{
    role: 'user',
    content: 'Get driving directions from Times Square to Central Park'
  }],
});
const result = await composio.provider.handleToolCalls(
  'your-user-id',
  response.output
);
console.log(result);
Get tools from Tool Router session and execute Mapbox actions with your Agent

Why Use Composio?

AI Native Mapbox Integration

  • Supports both Mapbox MCP and direct API based integrations
  • Structured, LLM-friendly schemas for reliable tool execution
  • Rich coverage for geocoding, mapping, and navigation features

Managed Auth

  • Centralized API key management with secure storage
  • Easy rotation and environment-specific credentials
  • Quickly onboard users without sharing sensitive keys

Agent Optimized Design

  • Tools tuned for natural language map queries and results
  • Reliable execution and full logging of agent interactions

Enterprise Grade Security

  • Fine-grained RBAC for Mapbox tool usage
  • Scoped access so agents only reach what they need
  • Complete audit trail of every map, search, or route request
FAQ

Frequently asked questions

Yes, Mapbox requires you to configure your own API key credentials. Once set up, Composio handles secure credential storage and API request handling for you.

Yes! Composio's Tool Router enables agents to use multiple toolkits. Learn more.

Composio is SOC 2 and ISO 27001 compliant with all data encrypted in transit and at rest. Learn more.

Composio maintains and updates all toolkit integrations automatically, so your agents always work with the latest API versions.

Start with Mapbox.It takes 30 seconds.

Managed auth, hosted MCP servers, and every Mapbox tool your agent needs.Free to start.

Start building