An AWS Labs Model Context Protocol (MCP) server for AWS Location Service
Project description
AWS Location Service MCP Server
Model Context Protocol (MCP) server for AWS Location Service
This MCP server provides tools to access AWS Location Service capabilities, focusing on place search, geographical coordinates, and route planning.
Features
- Search for Places: Search for places using geocoding
- Get Place Details: Get details for specific places by PlaceId
- Reverse Geocode: Convert coordinates to addresses
- Search Nearby: Search for places near a specified location
- Open Now Search: Search for places that are currently open
- Route Calculation: Calculate routes between locations with turn-by-turn directions
- Waypoint Optimization: Optimize the order of waypoints for efficient routing
Prerequisites
Requirements
- Have an AWS account with AWS Location Service enabled
- Install
uvfrom Astral or the GitHub README - Install Python 3.10 or newer using
uv python install 3.10(or a more recent version)
Installation
Here are the ways you can work with the AWS Location MCP server:
Configuration
Configure the server in your MCP configuration file. Here are some ways you can work with MCP across AWS, and we'll be adding support to more products soon: (e.g. for Amazon Q Developer CLI MCP, ~/.aws/amazonq/mcp.json):
{
"mcpServers": {
"awslabs.aws-location-mcp-server": {
"command": "uvx",
"args": ["awslabs.aws-location-mcp-server@latest"],
"env": {
"AWS_PROFILE": "your-aws-profile",
"AWS_REGION": "us-east-1",
"FASTMCP_LOG_LEVEL": "ERROR"
},
"disabled": false,
"autoApprove": []
}
}
}
Docker Configuration
After building with docker build -t awslabs/aws-location-mcp-server .:
{
"mcpServers": {
"awslabs.aws-location-mcp-server": {
"command": "docker",
"args": [
"run",
"--rm",
"-i",
"awslabs/aws-location-mcp-server"
],
"env": {
"AWS_PROFILE": "your-aws-profile",
"AWS_REGION": "us-east-1"
},
"disabled": false,
"autoApprove": []
}
}
}
Environment Variables
AWS_PROFILE: AWS CLI profile to use for credentialsAWS_REGION: AWS region to use (default: us-east-1)AWS_ACCESS_KEY_IDandAWS_SECRET_ACCESS_KEY: Explicit AWS credentials (alternative to AWS_PROFILE)FASTMCP_LOG_LEVEL: Logging level (ERROR, WARNING, INFO, DEBUG)
Tools
The server exposes the following tools through the MCP interface:
search_places
Search for places using AWS Location Service geocoding capabilities.
search_places(query: str, max_results: int = 5, mode: str = 'summary') -> dict
get_place
Get details for a specific place using its unique place ID.
get_place(place_id: str, mode: str = 'summary') -> dict
reverse_geocode
Convert coordinates to an address using reverse geocoding.
reverse_geocode(longitude: float, latitude: float) -> dict
search_nearby
Search for places near a specific location with optional radius expansion.
search_nearby(longitude: float, latitude: float, radius: int = 500, max_results: int = 5,
query: str = None, max_radius: int = 10000, expansion_factor: float = 2.0,
mode: str = 'summary') -> dict
search_places_open_now
Search for places that are currently open, with radius expansion if needed.
search_places_open_now(query: str, max_results: int = 5, initial_radius: int = 500,
max_radius: int = 50000, expansion_factor: float = 2.0) -> dict
calculate_route
Calculate a route between two locations with turn-by-turn directions.
calculate_route(
departure_position: list, # [longitude, latitude]
destination_position: list, # [longitude, latitude]
travel_mode: str = 'Car', # 'Car', 'Truck', 'Walking', or 'Bicycle'
optimize_for: str = 'FastestRoute' # 'FastestRoute' or 'ShortestRoute'
) -> dict
Returns:
distance_meters: Total route distance in metersduration_seconds: Estimated travel time in secondslegs: List of route legs with distance and durationturn_by_turn: List of navigation instructions with:distance_meters: Distance for this stepduration_seconds: Duration for this steptype: Maneuver type (e.g., 'Straight', 'Turn')road_name: Name of the road for this step
Example usage:
route = await calculate_route(
ctx,
departure_position=[-122.335167, 47.608013], # Seattle
destination_position=[-122.200676, 47.610149], # Bellevue
travel_mode='Car',
optimize_for='FastestRoute'
)
optimize_waypoints
Optimize the order of waypoints for efficient routing.
optimize_waypoints(
origin_position: list, # [longitude, latitude]
destination_position: list, # [longitude, latitude]
waypoints: list, # List of waypoints, each as a dict with 'Id' and 'Position' [longitude, latitude]
travel_mode: str = 'Car',
mode: str = 'summary'
) -> dict
Returns:
optimized_order: List of waypoint IDs in optimized ordertotal_distance_meters: Total route distance in meterstotal_duration_seconds: Total estimated travel time in secondswaypoints: List of waypoints with arrival and departure times
Example usage:
result = await optimize_waypoints(
ctx,
origin_position=[-122.335167, 47.608013], # Seattle
destination_position=[-122.121513, 47.673988], # Redmond
waypoints=[
{'Id': 'bellevue', 'Position': [-122.200676, 47.610149]},
{'Id': 'kirkland', 'Position': [-122.209032, 47.676607]}
],
travel_mode='Car'
)
get_coordinates
Get coordinates for a location name or address.
get_coordinates(location: str) -> dict
AWS Location Service Resources
This server uses the AWS Location Service APIs for:
- Geocoding (converting addresses to coordinates)
- Reverse geocoding (converting coordinates to addresses)
- Place search (finding places by name, category, etc.)
- Place details (getting information about specific places)
- Route calculation (finding routes between locations with turn-by-turn directions)
- Waypoint optimization (determining the most efficient order to visit multiple locations)
Security Considerations
- Use AWS profiles for credential management
- Use IAM policies to restrict access to only the required AWS Location Service resources
- Consider using temporary credentials or AWS IAM roles for enhanced security
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file awslabs_aws_location_mcp_server-1.0.1.tar.gz.
File metadata
- Download URL: awslabs_aws_location_mcp_server-1.0.1.tar.gz
- Upload date:
- Size: 70.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1710b7c71734c872ebe014a88fab6bb8e47d466e8bfb5f1ff7b7dd5d245a76a9
|
|
| MD5 |
f97466d6817a395ab60cae7ed31e2cb9
|
|
| BLAKE2b-256 |
9b02ab2f459d757687735c5ad65e4942e04d954dc6fabc3bc395e0d0a9a8296d
|
Provenance
The following attestation bundles were made for awslabs_aws_location_mcp_server-1.0.1.tar.gz:
Publisher:
release.yml on awslabs/mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
awslabs_aws_location_mcp_server-1.0.1.tar.gz -
Subject digest:
1710b7c71734c872ebe014a88fab6bb8e47d466e8bfb5f1ff7b7dd5d245a76a9 - Sigstore transparency entry: 208460231
- Sigstore integration time:
-
Permalink:
awslabs/mcp@79562e18e0380d0d972dedf948accbd407425962 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/awslabs
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@79562e18e0380d0d972dedf948accbd407425962 -
Trigger Event:
schedule
-
Statement type:
File details
Details for the file awslabs_aws_location_mcp_server-1.0.1-py3-none-any.whl.
File metadata
- Download URL: awslabs_aws_location_mcp_server-1.0.1-py3-none-any.whl
- Upload date:
- Size: 16.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f0d0389217a4ddf6095119373937503887931692c5b323f443784f5ce6919d7d
|
|
| MD5 |
3d10ebc6a3a07e62a080eb57466773a6
|
|
| BLAKE2b-256 |
87f03eca9262448a102285f0c8396fad60cb831d226ef719f044f50a50b441bd
|
Provenance
The following attestation bundles were made for awslabs_aws_location_mcp_server-1.0.1-py3-none-any.whl:
Publisher:
release.yml on awslabs/mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
awslabs_aws_location_mcp_server-1.0.1-py3-none-any.whl -
Subject digest:
f0d0389217a4ddf6095119373937503887931692c5b323f443784f5ce6919d7d - Sigstore transparency entry: 208460233
- Sigstore integration time:
-
Permalink:
awslabs/mcp@79562e18e0380d0d972dedf948accbd407425962 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/awslabs
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@79562e18e0380d0d972dedf948accbd407425962 -
Trigger Event:
schedule
-
Statement type: