JustRouting MCP
JustRouting MCP lets AI assistants such as Claude and Cursor use JustRouting for road routing, geocoding, distance and travel-time comparison, and multi-vehicle route optimization. Designed for Southeast Asia.What you can do
The tools are designed around three simple tasks:
- route — calculate
- table — compare
- optimize — decide
Installation
One-line installer
On macOS or Linux:justrouting-mcp.
To install a specific version:
From source
If you have Go installed:justrouting-mcp is available in your PATH.
Prebuilt binaries for supported platforms are also available from GitHub Releases.
Configuration
The server reads the JustRouting API key from theJUSTROUTING_API_KEY environment variable:
Which tool should I use?
Use the simplest tool that matches the user’s task:
A simple rule:
- One route →
route - Many routes to compare →
table - Many jobs to assign and order →
optimize - Place name or address →
geocodefirst
Tools
route
Calculate a route between two locations.
Use this tool when the user needs to:
- calculate driving distance
- estimate travel time
- get a route between two locations
- get route geometry
- understand which roads a route uses
- avoid specific road types
table instead.
Do not use it for assigning jobs to vehicles or ordering multiple stops. Use optimize instead.
Input
Motorcycle routing
profile is optional.
Set it to "motorcycle" when the user explicitly asks for a motorcycle or motorbike route.
Otherwise, omit profile to use the default driving profile.
Avoiding roads
Useexclude when the user explicitly asks to avoid a road type.
Supported values:
tollmotorwayferry
Output
distance_meters— route distance in metersduration_seconds— estimated travel time in secondsprofile— routing profile usedgeometry— simplified encoded polyline for the routesummary.roads— main roads used by the routesummary.tolls— whether the route uses toll roadssummary.ferry— whether the route includes a ferry crossing
geocode first.
table
Calculate a distance and/or travel-time matrix between multiple locations.
Use this tool when the user needs to:
- find the nearest driver, vehicle, store, or facility
- compare several destinations
- compare multiple origin-destination pairs
- build a distance or travel-time matrix
route instead.
Input
coordinates array.
For example:
[row][column] represents the route from that source to that destination.
For example:
0 to coordinate 2.
The response includes sources and destinations with the original coordinate indices so the matrix can be mapped back to the user’s locations.
Sources and destinations
Optionalsources and destinations restrict the matrix to subsets of the coordinate indices.
For example:
0 to coordinates 1 and 2.
Annotations
Use:duration— travel time in secondsdistance— distance in meters
Motorcycle routing
Set:profile.
Nearest-driver example
For a question such as:Which driver is closest to the customer?Keep the locations in a fixed order:
- Use
[0]as the source. - Use the driver indices as destinations.
- Read the corresponding values from the first matrix row.
- Ignore
nullvalues. - Choose the smallest distance or duration, depending on the user’s request.
Output
durations are in seconds.
distances are in meters.
A matrix value of null means that the origin-destination pair is unreachable.
Never interpret null as zero.
If the user provides place names or addresses instead of coordinates, call geocode first for every place. Keep the locations in the same order when constructing the matrix request.
geocode
Search for a place or address and convert it into coordinates.
Use this tool when the user provides:
- a place name
- a landmark
- a business
- a street address
- another location description
longitude,latitude format.
Structured input
The search is structured. Parse the user’s location into the fields that can be determined:name— place, landmark, or business namehousenumber— house or building numberstreet— street namepostcode— postal or ZIP codecity— city or localitycountry— country
Limit and filters
limit is optional and defaults to 1.
The maximum value is 10.
Use a larger limit when the location is ambiguous or the user asks for alternatives.
filters can optionally restrict the search.
For example:
Output
coordinates value is in longitude,latitude format and can be passed directly to route, table, or optimize.
When using geocode as part of a routing workflow, verify that the selected result matches the user’s intended place before passing its coordinates to the next tool.
If no result matches, the tool returns an error so the assistant can refine the search.
optimize
Assign jobs to vehicles and determine the order in which each vehicle should visit its assigned jobs.
Use this tool when the user needs to:
- assign multiple deliveries or pickups to vehicles
- plan routes for a fleet
- determine the order of multiple stops
- optimize a multi-vehicle routing solution
route.
Do not use it only to compare distances or travel times between locations. Use table.
Input
id.
Every job must have a unique id and a location.
Locations must use:
start or an end.
For a round trip, set both start and end to the same location:
start or end is omitted, the vehicle may start or end anywhere.
Vehicle profiles
Each vehicle can use its own routing profile. Use:profile to use the default driving profile.
For example:
Output
A simplified result looks like:routes[].steps to determine:
- which vehicle serves each job
- the order in which jobs are visited
- when each job is reached
job step contains the job ID, arrival time, travel duration, and travel distance for reaching that job.
Always check unassigned.
Do not assume that every job will be assigned.
If the user provides place names or addresses instead of coordinates, call geocode first for every location and use the selected coordinates in the optimization request.
Agent workflows
JustRouting MCP is designed so that AI assistants can combine the tools into larger workflows.Route between two places
For:How long does it take to drive from Marina Bay Sands to Changi Airport?Use:
- Geocode the origin.
- Geocode the destination.
- Verify the selected results match the intended places.
- Pass their
coordinatesvalues toroute.
Find the nearest driver
For:Which driver is closest to this customer?Use:
- Geocode the customer.
- Geocode each driver.
- Keep the locations in a fixed order.
- Put the customer in
sources. - Put the drivers in
destinations. - Compare the corresponding distance or duration values.
- Ignore unreachable
nullvalues.
Plan multiple vehicles
For:I have two vans and six customers. Assign the customers to the vans and determine the stop order.Use:
- Geocode each vehicle’s start/end location.
- Geocode every job location.
- Create one vehicle entry per vehicle.
- Create one job entry per customer.
- Call
optimize. - Read
routes[].stepsto determine each vehicle’s itinerary. - Check
unassignedfor jobs that could not be served.
Coordinate format
All routing tools use:Claude
Claude Code
Add JustRouting MCP with:Claude Desktop
Add the server toclaude_desktop_config.json:
