# MapQuest MCP

> MapQuest MCP Server handles location intelligence for your AI agent. It converts addresses into coordinates, calculates turn-by-turn routes for driving, walking, or cycling, and finds points of interest nearby. You can also map any specific location using a static image URL.

## Overview
- **Category:** data-analytics
- **Price:** Free
- **Tags:** geocoding, routing, mapping, location-services, directions, poi-search

## Description

This MapQuest MCP Server gives your agent location intelligence—it's basically an entire atlas bolted right onto the toolset. You use it whenever you need to know where something is or how to get there. It handles coordinates, full street addresses, points of interest (POIs), and static map images.

If you start with a physical address, your agent uses `geocode_address` to convert that full street name into precise latitude and longitude pairs. That's the first thing it does: pinpointing *where* an address is on the globe. Conversely, if all you've got are raw GPS coordinates—say, from a sensor reading—you run `reverse_geocode`. This tool takes those numbers and spits out the most probable, human-readable street address for that exact spot.

When it comes to figuring out where people actually go, your agent can search for local spots using `search_points_of_interest`. You tell it what kind of business you're looking for—maybe a coffee shop or a gas station—and the tool returns specific nearby locations around a given point. It doesn’t just guess; it finds real types of businesses in an area.

For trip planning, `get_directions` is your go-to function. This calculates full travel routes between two points and gives you more than just a straight line—it provides turn-by-turn instructions for driving, walking, or biking. It also tells you the estimated distance and how long the whole thing'll take. You can calculate multi-modal routes; it works whether your agent is operating in a car, on foot, or by bike.

If you need to show someone exactly where something is, even if you don't want them to use a live map service, `get_static_map_url` generates that URL. You feed the coordinates into this tool, and it hands you an image URL ready for display—a static picture of the map centered right on those specific points. It’s perfect for embedding location data directly into reports or messages without needing a live map connection.

You'll use these tools together all the time. For instance, if you need to plan a route (using `get_directions`), but you only have an address instead of two sets of coordinates, you first run that address through `geocode_address` to get your starting and ending latitude/longitude pairs. Then, you pass those resulting coordinates into `get_directions`. If the trip involves finding the nearest car wash along the way, you use `search_points_of_interest` near a point on the calculated route. Finally, if someone needs a visual confirmation of the entire path, you feed the key coordinate points into `get_static_map_url` to generate the final image link.

Don't think of it as just five separate buttons. Think of it as a complete location stack for your agent. You can verify an address (using `geocode_address`), then figure out what that spot is called in plain English (using `reverse_geocode`). You can find the nearest service station nearby (via `search_points_of_interest`) and calculate how long you'll take to get there, whether you drive or walk (`get_directions`). If you need to share a picture of the neighborhood map, `get_static_map_url` handles that. It’s reliable infrastructure for any task involving geography.

## Tools

### geocode_address
Converts a full street address into precise latitude and longitude coordinates.

### get_directions
Calculates travel routes, providing turn-by-turn directions for driving, walking, or cycling between two points.

### get_static_map_url
Generates a URL that displays a static map image centered on specified coordinates.

### reverse_geocode
Converts geographic coordinates into the most likely human-readable street address.

### search_points_of_interest
Finds specific types of nearby locations, like restaurants or gas stations, around a given area.

## Prompt Examples

**Prompt:** 
```
What are the coordinates for the White House?
```

**Response:** 
```
The coordinates for 1600 Pennsylvania Ave NW are latitude 38.897675 and longitude -77.036547.
```

**Prompt:** 
```
Get driving directions from New York to Philadelphia.
```

**Response:** 
```
The estimated travel time is 1 hour and 45 minutes (approx. 94 miles). The route starts via I-95 South...
```

## Capabilities

### Determine Coordinates from an Address
You pass a street address to `geocode_address`, and it returns the exact latitude/longitude pair.

### Plan Multi-Modal Routes
The agent uses `get_directions` to calculate travel time, distance, and turn-by-turn instructions for cars, feet, or bikes.

### Find Human Address from Coordinates
If you only have a GPS point, run `reverse_geocode` to get the corresponding street address.

### Locate Nearby Businesses
Use `search_points_of_interest` to query for specific types of local spots (like car washes or coffee shops) near a point.

### Generate Map Images
You feed coordinates into `get_static_map_url`, and it gives you an image URL ready for display.

## Use Cases

### Planning a Supply Run
A logistics manager needs to service three stops. They ask their agent: 'Figure out the optimal route visiting these addresses.' The agent first uses `geocode_address` on all three points, then chains those coordinates into `get_directions`, giving the total distance and estimated time for the whole run.

### Verifying a Client's Location
A researcher gets raw GPS data from a client. They ask: 'What address does these coordinates belong to?' The agent runs `reverse_geocode` instantly, providing the confirmed street address for documentation purposes.

### Building an Event Map
You are designing an event page and need a map image. You tell your agent: 'Show me a static map of the convention center.' The agent calls `get_static_map_url` using the known coordinates, returning a ready-to-embed image.

### Competitive Analysis
A local business owner wants to know what services are within two miles of their shop. They ask: 'Search for all dry cleaners and gas stations near this address.' The agent uses `geocode_address` first, then calls `search_points_of_interest` with the correct parameters.

## Benefits

- Calculate full travel plans instantly. Instead of opening a map, running `get_directions` gives the agent accurate driving, walking, or cycling times for immediate use.
- Turn fuzzy addresses into hard data points. Use `geocode_address` to convert any street address into reliable latitude/longitude coordinates before feeding them into other tools.
- Identify exactly what's nearby. Running `search_points_of_interest` pulls up lists of local businesses, whether you need a coffee shop or an auto repair shop.
- See the picture without drawing it. `get_static_map_url` creates an image link so your agent can show a user exactly where something is located in one clean output.
- Pinpoint the source address. If all you have is raw GPS data, `reverse_geocode` figures out the street address for you.

## How It Works

The bottom line is: your AI client manages the API calls; you just tell it what location job needs doing.

1. First, subscribe to the server and provide your MapQuest Consumer Key.
2. Next, tell your agent what you need—for example, 'Find gas stations near 34th Street.'
3. The agent executes the necessary tool (`search_points_of_interest`), gets the data back, and presents the result to you.

## Frequently Asked Questions

**How does geocode_address work?**
The `geocode_address` tool takes a full street address string and returns exact latitude and longitude numbers. This is always the best first step if you only have text.

**Can I calculate directions for walking using get_directions?**
Yes, absolutely. When calling `get_directions`, specify 'walking' as the mode of transport. The tool calculates routes optimized for foot traffic and provides a walk time estimate.

**Does search_points_of_interest need coordinates?**
Yes, it does. You must first use `geocode_address` to get the latitude/longitude of the area you want to search around; then pass those coordinates into `search_points_of_interest`.

**What is reverse_geocode?**
`reverse_geocode` does the opposite of geocoding. If you have a raw GPS coordinate (like 34.05, -118.24), it runs this tool to tell you what street address that point represents.

**How do I get an image of a map with get_static_map_url?**
You pass the coordinates into `get_static_map_url`. The agent responds with a direct URL. You can then embed that URL anywhere in your application or document.

**What credentials do I need to successfully call `get_directions`?**
You must provide a valid MapQuest Consumer Key. This key is required for authentication and must be configured in your AI client's settings before making any requests.

**If the address I give to `geocode_address` is wrong, how does the server handle it?**
The tool returns a structured error response. It won't guess or fail silently; instead, you get specific status codes telling your agent exactly why the location could not be found.

**Can I use `search_points_of_interest` to look for multiple types of businesses at once?**
Yes. You can pass a list of categories (like 'park', 'cafe', and 'bank') in one call. The server processes these distinct searches and returns separate results for each type.

**Where do I get a MapQuest API Key?**
You can get a free 'Consumer Key' by signing up at the [MapQuest Developer Network](https://developer.mapquest.com/). The free tier includes a generous amount of monthly transactions.

**Does it support international addresses?**
Yes, MapQuest provides global geocoding and routing coverage for most countries worldwide.