# Mapbox Alternative MCP

> Mapbox Alternative lets your AI agent handle complex geospatial tasks: calculate driving routes, run spatial queries on datasets, and generate static map images using natural language prompts. You can use it for geocoding addresses, finding optimal travel paths between multiple points, or viewing data layers directly from a chat window.

## Overview
- **Category:** developer-tools
- **Price:** Free
- **Tags:** mapping, geospatial, navigation, gis, location-services

## Description

Listen up. This server lets your AI client handle heavy-duty mapping and geospatial work right from chat. You don't need a whole separate stack of services; you just talk to your agent, and it handles the coordinates, routes, and data pulls for ya.

**Finding Locations (Search & Geocoding)**
You can nail down any address or point of interest using interactive searches. When you start typing a location name, the system uses **`searchbox_suggest`** to give you real-time autocomplete options. Once you pick one, running **`searchbox_forward`** performs an initial search lookup for that spot. If you need all the details—like the full address and geometry—you use **`searchbox_retrieve`**. Need to work backward? Use **`geocode_reverse`**; it takes coordinates (lat/lon) and tells you what street address they belong to. For the opposite, if you have an address string but need the exact numbers, run **`geocode_forward`** to find the nearest valid location based on your set of coordinates.

If you're dealing with a bunch of addresses at once—say, a whole list for a mailing campaign—you batch them up using **`geocode_batch`**, and it converts all those names into coordinates in one go. To check what specific address a set of coordinates is closest to, you use **`geocode_forward`** again.

**Calculating Routes & Movement (The Hard Stuff)**
This is where the power's at. You can calculate turn-by-turn driving directions and get time estimates using **`get_directions`**. If you need to know how long it takes to get between multiple points, or what the distance is for a bunch of different spots simultaneously, run **`get_matrix`**.

For complex trips—like having a delivery driver hit five different stops and needing the absolute shortest path—you use **`get_optimization`**. You can also feed those multi-stop problems into **`submit_optimization`** to solve them for your whole fleet. Beyond simple driving, you can figure out areas reachable within a specific time or distance using **`get_isochrone`**, which computes that required shape.

**Working with Data & Maps (Datasets and Tiles)**
You don't just get lines on a map; you get data. You first check what datasets are available to you by calling **`list_datasets`**. Once you know the dataset, you can pull specific points of interest or data features using **`get_dataset_feature`**, and if that feature needs correcting, run **`update_dataset_feature`**.

When you need to pinpoint exactly what kind of data lives at a precise spot on the map (a latitude and longitude), use **`get_tilequery`**. If you're downloading raw structured geometry for advanced processing, **`get_vector_tile`** gives you that Mapbox Vector Tile (MVT) format. For standard images, **`get_raster_tile`** downloads a basic image tile (PNG or JPG). You can also create and manage custom map layers: use **`create_tileset_source`** to build your source for the Tiling Service, then you can make it public with **`publish_tileset`**. To generate a single, viewable JPEG of a specific area at a given zoom level, run **`get_static_image`**.

**Utility and Account Management**
To get started or manage access, the system lets you handle tokens. You can create a new secure token using **`create_token`**, see every token stored on your profile with **`list_tokens`**, delete old ones with **`delete_token`**, and review all of that history by calling **`list_tokens`**. If you want to pass along any thoughts about how the service works, use **`get_feedback`** or **`submit_feedback`**.

## Tools

### geocode_reverse
Takes coordinates and figures out what address or place they belong to.

### get_dataset_feature
Pulls specific data points (features) from a defined dataset by ID.

### get_directions
Calculates the shortest path, providing turn-by-turn instructions and travel time estimates.

### get_feedback
Collects user feedback about your mapping experience.

### get_isochrone
Computes a shape showing all points reachable from a starting point within a specific time or distance.

### get_map_matching
Snaps rough GPS tracks to the nearest valid road network lines for cleanup.

### get_matrix
Returns travel times and distances between multiple different points simultaneously.

### get_optimization
Recovers a solution that solves complex routing problems, like the Traveling Salesperson Problem.

### get_raster_tile
Downloads an image tile (PNG, JPG) from a Mapbox-hosted tileset.

### create_tileset_source
Builds a source for the Mapbox Tiling Service (MTS).

### create_token
Generates and stores a new access token for your account.

### delete_token
Removes an existing access token from your profile.

### geocode_batch
Converts many addresses into coordinates in one batch process.

### geocode_forward
Finds the nearest address or location based on a set of coordinates.

### get_static_image
Generates a single, viewable map image for specific coordinates and zoom level.

### get_tilequery
Retrieves detailed data about features at a precise point on the map (lat/lon).

### get_vector_tile
Downloads raw, structured vector data (MVT) from a Mapbox-hosted tileset.

### list_datasets
Lists all geographic datasets associated with your account.

### list_tokens
Shows you every access token currently stored on your profile.

### publish_tileset
Makes a Mapbox Tiling Service (MTS) tileset publicly available for others to use.

### searchbox_forward
Performs an initial search lookup using the Search Box API.

### searchbox_retrieve
Gets full, detailed information about a location suggested by the user.

### searchbox_reverse
Performs a reverse search to find a known place by coordinates.

### searchbox_suggest
Provides real-time autocomplete suggestions as you type an address or location name.

### submit_feedback
Allows you to submit general user feedback regarding the service usage.

### submit_optimization
Runs a complex algorithm to solve multi-stop route planning problems for fleets.

### update_dataset_feature
Changes or corrects specific data points within an existing dataset feature.

## Prompt Examples

**Prompt:** 
```
Calculate a driving route between -74.006,40.7128 and -71.0589,42.3601.
```

**Response:** 
```
I've calculated the route from New York to Boston. The optimal path covers approximately 215 miles with an estimated travel time of 3 hours and 45 minutes via I-95 N.
```

**Prompt:** 
```
Generate a static map image for San Francisco at zoom level 12.
```

**Response:** 
```
I've generated the static map for San Francisco (Lon: -122.4194, Lat: 37.7749) at zoom 12. You can view the image here: [Map Image URL].
```

**Prompt:** 
```
List all my Mapbox datasets for username 'dev_user'.
```

**Response:** 
```
I found 3 datasets for 'dev_user': 'city-parks-v1' (ID: cl123...), 'office-locations' (ID: cl456...), and 'transit-routes' (ID: cl789...). Which one would you like to inspect?
```

## Capabilities

### Calculate Optimal Routes
Calculates turn-by-turn directions and the best travel time between two or more points.

### Map Coordinates to Addresses
Takes a set of coordinates (lat/lon) and returns human-readable addresses using forward geocoding.

### Search Locations by Name
Performs interactive location searches, providing autocomplete suggestions for addresses or points of interest.

### Manage Dataset Features
Lets you list, retrieve details on, and update specific geographic features within your linked datasets.

### Compute Reachable Areas (Isochrones)
Calculates the geographical area a point can reach given a specified time limit or distance radius.

## Use Cases

### Optimizing a Delivery Route
A field manager has 15 stops and needs the most efficient order. Instead of mapping it out manually in an external tool, they prompt their agent: 'Calculate the optimal route for these 15 addresses.' The agent runs `get_matrix` to get all distances and then uses `submit_optimization`, returning the perfect, sequenced driving plan.

### Checking Service Area Boundaries
A retail buyer needs to know if a new store location is within reasonable reach of their existing 10 distribution centers. They ask the agent to run `get_isochrone` from the proposed site, using a 30-minute driving radius to check immediate coverage.

### Analyzing Data Layers in GIS
A city planner needs to know if specific zoning rules apply at a parcel of land. They first use `list_datasets` to find the 'Zoning Map,' then run `get_tilequery` on the coordinates, getting back the exact regulatory data needed for their report.

### Quickly Generating Presentation Maps
A real estate agent needs a map of a neighborhood's potential selling area for a client pitch. They ask the agent to 'Generate a static image of this block at zoom 15.' The agent uses `get_static_image` and returns a ready-to-paste, high-quality JPEG.

## Benefits

- Stop copying coordinates. Use `geocode_forward` or `searchbox_suggest` to let your agent handle all lookups, converting addresses into precise lat/lon points instantly.
- Don't waste time on single routes. Run multi-stop logistics using `get_matrix` to compare travel times and distances between dozens of locations in one call. Then refine the order with `submit_optimization`.
- Need visual data? Instead of opening a map editor, use `get_static_image` to generate an image right in your chat window for reports or presentations.
- Working with raw GIS data? Use `list_datasets` and then `get_dataset_feature` to pull specific attributes (like population density or zoning codes) directly from the dataset structure.
- Planning service coverage? Don't guess. Run `get_isochrone` to precisely calculate the area a branch can cover within, say, 20 minutes of driving time.

## How It Works

The bottom line is you send a simple request in natural language and get actionable geographical data back without leaving your editor.

1. Subscribe to this server and enter your Mapbox Access Token (Public or Secret).
2. Your AI client uses the token to connect to the geospatial API.
3. You prompt the agent with a query, like 'Calculate the fastest route from A to B'—the system returns the structured data.

## Frequently Asked Questions

**How do I use get_directions to find a route?**
You ask your agent for directions between two points, providing coordinates or addresses. The agent uses `get_directions` and returns the optimal path, including turn-by-turn instructions and total travel time.

**What is the difference between get_matrix and get_isochrone?**
The key difference is purpose: `get_isochrone` calculates a *reachable area* (a shape) from one point based on time/distance. `get_matrix` calculates multiple specific travel times and distances *between* many distinct points.

**Can I update data using get_dataset_feature?**
Yes, if you know the feature ID and the new data values, you can run `update_dataset_feature`. This lets your agent change a specific attribute (like changing a business's operating hours) within your connected dataset.

**How do I search for an address using searchbox_suggest?**
You simply ask the agent to 'Find restaurants near 123 Main St.' The agent uses `searchbox_suggest` and provides live, autocomplete suggestions as you refine the location name.

**What should I use for authentication when calling `get_dataset_feature`?**
You must pass an active access token. Use the `create_token` tool first to generate a secure key, then include that token in your agent's context. This keeps your data interactions authenticated and traceable.

**When should I use `get_vector_tile` instead of `get_raster_tile`?**
Vector tiles provide raw, structured geometry (MVT or PBF). Raster tiles deliver pre-rendered images (PNG/JPG). Use vector when you need to style the map dynamically within a client; use raster for quick visual output.

**How does `submit_optimization` solve complex fleet routes?**
It solves the Traveling Salesperson Problem (TSP). You feed it multiple required stops, and the tool returns the optimal sequence to hit every location. It minimizes total travel time for your entire route.

**What's the most efficient way to geocode hundreds of addresses?**
Use `geocode_batch` for bulk processing. Instead of running single-point searches repeatedly, this tool handles large lists of coordinates or addresses in one go. This saves calls and processes your data much faster.

**Can I calculate driving directions between two points using this server?**
Yes! Use the `get_directions` tool. You need to provide a routing profile (like `mapbox/driving`) and the coordinates as a semicolon-separated string of longitude and latitude.

**How do I find information about map features at a specific coordinate?**
You can use the `get_tilequery` tool. By providing a tileset ID and the longitude/latitude, the agent will retrieve data about the specific features located at that point.

**Is it possible to update my Mapbox datasets through the AI?**
Yes, the `update_dataset_feature` tool allows you to modify a specific feature within a dataset by providing the dataset ID, feature ID, and the new GeoJSON data.