Skip to main content
The JustRouting MCP server lets MCP-compatible AI assistants — Claude, Cursor, and others — calculate routes and geocode places directly. It exposes two tools:
  • route — distance and travel duration between two locations, driving or motorcycle
  • geocode — convert a place name or address into coordinates, ready to feed into route
The server is a thin stdio process built on the official JustRouting Go client, so authentication, retries, and rate-limit handling are inherited from the API. Source code and releases are on GitHub.

Installation

One-line installer (macOS / Linux)

Downloads the latest prebuilt binary for your OS/architecture, verifies its checksum, and installs it to /usr/local/bin (or ~/.local/bin). No Go required. Pin a specific version:

From source (Go users)

Requires Go 1.25+. Make sure justrouting-mcp is on your PATH. Prebuilt binaries for macOS, Linux, and Windows are also attached to every release.

Configuration

The server reads the JustRouting API key from the JUSTROUTING_API_KEY environment variable:
See Authentication for creating an API key.

Tools

route

Calculate a route between two locations — driving by default, or motorcycle when requested.
profile is optional: set it to "motorcycle" for a motorcycle route, or omit it (or use "car") for the default driving route. When the user mentions a motorcycle or motorbike, the assistant sets profile to "motorcycle". Coordinates use longitude,latitude order. If the user asks about places by name or address instead of coordinates, call geocode first and pass its coordinates values here.
  • distance_meters — driving distance in meters
  • duration_seconds — estimated travel time in seconds

geocode

Search for places and convert a place name or address into coordinates. Use this before route when the user refers to places by name. The search is structured: the assistant parses the user’s place reference into address components and passes only the ones it can determine — name, housenumber, street, postcode, city, country. Prefer including country (and city) when the context implies them — they are the strongest disambiguators for common, abbreviated, or misspelled names.
At least one component is required. limit is optional and defaults to 1 (best match only); it must not exceed 10. filters is also optional, for example "filters": ["countrycode:sg"] to restrict results to Singapore.
Results are ordered best first. The coordinates field is ready to pass to route. If nothing matches, the tool returns an error.

Asking about places by name

For a prompt such as “how long from ‘marina bay singapore’ driving to ‘changqi airport’?”, the assistant geocodes each place and then routes:
  1. geocode with "name": "marina bay", "country": "singapore" → take coordinates
  2. geocode with "name": "changqi airport" → take coordinates
  3. route with the two coordinates values as origin and destination (omit profile for driving)

Claude

Claude Code (CLI):
Claude Desktop — add the server to claude_desktop_config.json:

Cursor

Add the MCP server with the same JSON configuration (Settings → MCP → Add new MCP server):