Get the FREE Ultimate OpenClaw Setup Guide →

google-routes

Google Routes API MCP Server (with Geocoding)

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio bitsmuggler-google-routes-mcp-server npx ts-node [path to the local repo]/src/server.ts \
  --env GOOGLE_MAPS_API_KEY="[your api key]"

How to use

This MCP server provides a Google Routes experience driven by the Model Context Protocol. It accepts an origin and destination address, uses the Google Geocoding API to convert those addresses to coordinates, and then computes a route between them using the Google Routes API. It supports options such as travel mode (driving, walking, bicycling, etc.), routing preferences, units, and the ability to request alternative routes. After starting the server, you can interact with it via LM Studio, Claude Desktop, or your MCP client by supplying a prompt that includes origin and destination data and, optionally, preferences. The server will respond with a structured context that includes the computed route details, estimated time, distance, and any alternative routes if requested.

How to install

Prerequisites:

  • Node.js (recommended LTS) and npm/yarn installed
  • Access to a Google Maps API key with Geocoding and Routes APIs enabled

Installation steps:

  1. Clone or download the repository: git clone https://github.com/your-org/bitsmuggler-google-routes-mcp-server.git cd bitsmuggler-google-routes-mcp-server

  2. Install dependencies: npm install

    or yarn install

  3. Ensure you have a Google Maps API key and prepare environment variables

    • Create a .env file or export GOOGLE_MAPS_API_KEY in your environment
  4. Run the MCP server using the provided configuration example (via npx): npx ts-node src/server.ts

  5. Verify the server is listening on the expected port (default usually 3000 or as configured in the code)

Optional: If you publish this locally, you can also run via the exact mcp_config example by loading it into your MCP runner which respects the command and env block.

Additional notes

Notes and tips:

  • Replace [path to the local repo] with the actual filesystem path when using ts-node locally.
  • Ensure GOOGLE_MAPS_API_KEY has Geocoding and Routes API access enabled and that billing is configured on the Google Cloud project.
  • Be mindful of Google API quotas and rate limits; implement caching if you plan to handle many requests.
  • The MCP response will include route details such as distance, duration, and optional alternative routes if requested by the client.
  • If you encounter authentication or quota errors, check that the API key is valid, not restricted improperly, and that the Google Maps services are enabled for the project.
  • For production deployments, consider containerization or a process manager to keep the server running and to manage environment variables securely.

Related MCP Servers

Sponsor this space

Reach thousands of developers