Travel Planner MCP Server — Google Maps API
Plan and manage travel itineraries with this MCP server integrating Google Maps API for location search, place details, and optimized route calculations.
npx -y @GongRzhe/TRAVEL-PLANNER-MCP-ServerOverview
This MCP (Model Context Protocol) server integrates Google Maps APIs to provide location search, place detail lookup, and optimized route calculations as tools that can be called by an LLM or other orchestration layer. It exposes a simple HTTP server that implements MCP-style tool metadata and endpoints so conversational agents can discover and invoke location-related capabilities programmatically.
For developers building travel assistants, itinerary planners, or location-aware chatbots, this server centralizes Google Maps operations (Places, Geocoding, Directions/Routes) behind a small, self-hosted API. That allows an LLM to request structured data (search results, coordinates, place attributes, optimized multi-stop routes) without embedding API keys or parsing raw Maps responses inside the model context.
Features
- Exposes MCP-compatible tools for:
- Location / place search (query -> ranked places)
- Place details lookup (place_id -> details, photos, address)
- Route optimization (multi-stop route optimization and directions)
- Returns structured JSON outputs designed for use by LLMs or other agents
- Simple configuration via environment variables (.env) or Docker
- Rate-limit and error handling wrappers to surface friendly errors to callers
- Example request/response shapes and sample payloads for quick integration
Installation / Configuration
Prerequisites:
- Node.js 16+ (or Docker)
- A Google Maps API key with appropriate APIs enabled (Places, Geocoding, Directions/Routes)
Clone the repo and install dependencies:
Create a .env file in the project root with these variables:
# .env
PORT=8080
GOOGLE_MAPS_API_KEY=your_google_maps_api_key_here
LOG_LEVEL=info
Start the server (development):
# or
Docker (optional):
# build
# run
Notes:
- Ensure your Google API key has billing enabled and the necessary APIs switched on in the Google Cloud Console.
- Adjust PORT and logging settings to match your deployment environment.
Available Tools / Resources
The server exposes a small set of HTTP endpoints intended for MCP discovery and invocation. Typical endpoints:
| Endpoint | Method | Description |
|---|---|---|
| /mcp/tools | GET | Returns tool metadata (name, description, input schema) for agent discovery |
| /search | POST | Query-based place search (query, location bias, radius) |
| /details | POST | Fetch place details by place_id |
| /optimize | POST | Optimize multi-stop route and return directions & travel times |
| /health | GET | Simple health check/status |
Example: GET tool metadata
Example tool metadata (partial):
API Examples
Search example:
Typical response:
Route optimization example:
Response includes ordered waypoints, total duration, distance, and step-by-step directions.
Use Cases
- Day trip planning: An assistant can search attractions near a user’s hotel, fetch details (opening hours, ratings), and produce an optimized route to visit several spots within a time window.
- Multi-stop itinerary optimization: Given a list of desired stops, the MCP server can compute an efficient driving route and return explicit directions for navigation or for display in a UI.
- Location-aware chatbots: Let an LLM call the search and details tools during a conversation to present verified place names, addresses, or photo references, reducing hallucinations.
- Travel app backend: Use the server as a thin abstraction layer for Google Maps calls to centralize API key usage, apply logging, and enforce rate limits before serving data to mobile/web clients.
Operational Considerations
- Billing and quotas: Google Maps APIs bill per request; monitor usage and set quotas in Google Cloud.
- Rate limiting: Deploy rate limiting in front of the server (API gateway) if multiple agents will call it concurrently.
- Caching: Consider caching place details and route results to reduce repeated external API calls and latency.
- Security: Keep your GOOGLE_MAPS_API_KEY secret. For production, use secret managers and restrict key usage by HTTP referrer or IP addresses.
This MCP server provides a compact, agent-friendly bridge between LLM-driven workflows and Google Maps capabilities—ideal for building travel planning assistants and location-sensitive automation.