MCP Server
Connect Routal to Claude, ChatGPT, or any MCP client to import stops, optimize plans, and read operational analytics by chatting with your AI assistant.
Routal ships a hosted MCP server. Connect it once and your AI assistant can list your projects, import stops, create and optimize plans, and answer questions about your operation, using your own Routal account and your own permissions. One server works across every MCP client: Claude, ChatGPT, Claude Code, Cursor, and anything else that speaks the protocol. This page is the setup guide for all of them.
Connection details
| Server URL | https://api.routal.com/mcp |
| Transport | Streamable HTTP |
| Authentication | OAuth 2.1. Sign in with your Routal account when the client prompts you |
| Credentials needed | None. No API key, no configuration: the OAuth flow handles everything |
The server supports dynamic client registration and PKCE, so any compliant MCP client can connect without pre-registered credentials. The assistant acts as your Routal user: it sees the same projects, plans, and stops you see in planner.routal.com, and nothing more.
Directory listing vs. manual URL
If Routal appears in your client's connector or app directory, connect from there: one click, same server. The steps below are for connecting by URL directly, which works today on every client.
Connect from Claude
On claude.ai (web, desktop, or mobile; requires a paid Claude plan):
- Open Settings → Connectors.
- Click Add custom connector.
- Paste
https://api.routal.com/mcpand click Add. - Click Connect and sign in with your Routal account when the OAuth window opens.
In a new conversation the Routal tools are available. Claude asks for confirmation before any tool that writes data.
For Claude Code, add the server from your terminal:
claude mcp add --transport http routal https://api.routal.com/mcpThen run /mcp inside Claude Code to complete the OAuth sign-in.
Connect from ChatGPT
On chatgpt.com (web; requires Plus, Pro, Business, Enterprise, or Edu):
- Enable developer mode: Settings → Apps & Connectors → Advanced settings → Developer mode.
- Go to Settings → Apps & Connectors and create a new connector:
- Name:
Routal - MCP server URL:
https://api.routal.com/mcp - Authentication: OAuth
- Name:
- Sign in with your Routal account when the OAuth window opens.
- In a conversation, open the composer's tool menu and enable the Routal connector.
ChatGPT's exact menu names shift between releases. If you don't see these options, check OpenAI's developer mode guide.
Connect from any other MCP client
Any client that supports Streamable HTTP with OAuth works. The generic configuration shape:
{
"mcpServers": {
"routal": {
"type": "http",
"url": "https://api.routal.com/mcp"
}
}
}Cursor, VS Code, Windsurf, and most agent frameworks accept exactly this in their MCP settings file, then trigger the OAuth sign-in on first use.
What the assistant can do
The server exposes 22 tools. Read tools run freely; well-behaved clients ask for your confirmation before the nine tools that write.
Discover & set up
| Tool | What it does |
|---|---|
list_projects | Lists the projects your account can access. |
get_import_schema | Which stop fields and constraints a project accepts: time windows, pickups, weight, custom fields. |
get_organization_resources | Your usage vs. subscription limits (users, vehicles, stops per plan, SMS/WhatsApp/geocode credits). |
Plans, stops & fleet
| Tool | What it does |
|---|---|
create_plan ✏️ | Creates an empty plan for an execution date. |
update_plan ✏️ | Changes a plan's label, execution date, or status. Its stops and routes stay as they are. |
import_stops ✏️ | Imports up to 100 stops per call. Geocodes addresses and supports time windows, pickup+delivery pairs, driver tasks, and per-parcel packages. |
update_stop ✏️ | Edits one stop: coordinates, time window, duration, skills, tasks. Doesn't geocode, so pass lat/lng to move it. |
search_stops | Filters stops by predicate: status, execution date, cancel reason, text fields. |
get_stop | Full detail for one stop: contact details, custom fields, tasks, reports. |
move_stops ✏️ | Moves stops to another plan or back to the unassigned inbox. |
list_plans | Paginated plan summaries with status, date-range, and text filters. |
get_plan | Full detail for one plan: every stop, route, and vehicle. |
list_vehicles | The project's fleet: capacities, skills, pricing, enabled state. |
Routes
| Tool | What it does |
|---|---|
create_routes ✏️ | Adds routes to a plan, one per vehicle, with their constraints and pricing. Stops go in afterwards with reorder_route, or optimize_plan does both. |
assign_route ✏️ | Assigns or reassigns a route's vehicle, or changes its status, limits (distance, time, weight, volume), or pricing. Reassigning a dispatched route sends the driver link to the new driver. |
reorder_route ✏️ | Sets which stops a route visits and in what order, and recomputes ETAs. Stops left out go back to the plan, unassigned. |
search_routes | Filters routes by predicate: plan, vehicle, status, label, dates. No need to load the whole plan. |
get_route | One route with its stops in order, its capacity limits, and the load it carries. |
Optimize
| Tool | What it does |
|---|---|
optimize_plan ✏️ | Starts an optimization run: assigns stops to vehicles, orders them, computes ETAs. Asynchronous. |
get_optimization_status | Polls whether the run is still going. |
get_last_optimization | The finished result: route assignments, stop timings, unassigned stops. |
Analyze
| Tool | What it does |
|---|---|
get_analytics | Time series for stop counts, cancellation reasons, proof-of-delivery, and plan counts, bucketed by day/week/month/quarter/year. |
✏️ = writes data.
Prompts to try
Import these stops into a new plan for tomorrow and optimize it: [paste rows from your spreadsheet]
Which deliveries were canceled this week, and what was the most common reason?
Find Friday's incomplete stops and move them to Monday's plan.
How close are we to our subscription limits? I want to add five vehicles.
A typical planning session chains the tools for you: the assistant resolves
your project (list_projects), checks what fields it accepts
(get_import_schema), creates the plan, imports the stops in batches of 100,
starts the optimization, polls until it finishes, and reads back the routes,
including any stops the optimizer could not place.
Close the loop with webhooks
The assistant plans in the chat; your ERP, OMS or CRM still has to hear about it, and about what drivers do afterwards. Every tool call goes through the same API your integration uses, so it fires the same webhooks:
You, in Claude or ChatGPT Routal Your endpoint
───────────────────────── ────── ─────────────
"Plan tomorrow and optimize" ──▶ create_plan ──▶ plan.created
import_stops ──▶ stop.created (one per stop)
optimize_plan ──▶ optimization.succeeded / .failed
"Show me the routes" ◀── get_last_optimization
dispatch from the planner
Drivers run the day ──▶ route.started
──▶ stop.reported (with POD)
──▶ route.finished
"What failed this week?" ◀── get_analyticsWhat that means in practice:
- A plan built in a chat reaches your systems like any other. Your
webhook receives
plan.created, onestop.createdper imported stop and the optimization result, with no extra setup on the assistant's side.update_plansendsplan.updated; the route tools (create_routes,assign_route,reorder_route) andupdate_stopfire no webhook. - Execution never goes through the chat.
route.started,stop.reportedandroute.finishedcome from the driver app and go to your endpoint. That's where orders get closed and proof of delivery stored. Ask the assistant later for the summary (get_analytics,search_stops). - The MCP server doesn't dispatch or manage webhooks. Send routes to
drivers from the planner or from your integration. Create the webhook once
with
POST /v2/webhookor in the planner's developer settings; a coding assistant such as Claude Code can write that setup for you from Build with AI. - Runs started in the chat fire
optimization.succeededtoo. The recipes only dispatch runs the integration started itself, so an optimization launched from a chat waits for a person to review and dispatch it. Keep that rule if you copy their handler.
Subscribe your webhook to these events for the full cycle:
[
"routal.planner.2.plan.created",
"routal.planner.2.stop.created",
"routal.optimizer.2.optimization.succeeded",
"routal.optimizer.2.optimization.failed",
"routal.drivers.2.route.started",
"routal.planner.2.stop.reported",
"routal.drivers.2.route.finished"
]Security & data access
- You authorize with OAuth, per user. The server never sees an API key, and the assistant can only touch data your Routal user can touch.
- Writes are opt-in. The nine writing tools are annotated as such; Claude and ChatGPT ask for confirmation before running them. Everything else is read-only.
- Writes reach your webhooks. A plan, stop or optimization created from the chat, or a plan updated there, is delivered to every webhook of the project. Calling one of those tools twice delivers the webhook twice, which is why they are not marked idempotent.
- Revoke anytime. Remove the connector in your client's settings and its access token stops working.
- Tool results flow through your AI provider. What the tools return is processed by Claude or ChatGPT under that provider's data policies, the same consideration as pasting the data into the chat yourself.
Troubleshooting
| Symptom | Fix |
|---|---|
Tools fail with mcp.error.unauthorized after working before | The OAuth token was revoked or expired. Disconnect and reconnect the connector to sign in again. |
| Optimization "finished instantly" but routes look unchanged | Optimization is asynchronous: the start call returns immediately. Ask the assistant to poll the status and read the result when the run completes. |
| "An optimization is already in progress" | One run per plan at a time. Wait for the current run to finish, then retry. |
| Importing hundreds of stops feels slow | import_stops caps at 100 stops per call by design; the assistant batches automatically. |
| Tools don't appear in ChatGPT | Refresh the connector in Settings → Apps & Connectors and make sure it's enabled in the conversation's tool menu. |
| The assistant optimized a plan but your system heard nothing | Check that the webhook is enabled and subscribed to routal.optimizer.2.optimization.succeeded, then look for the delivery in GET /v2/webhook/{id}/events. |
| Your ERP received a plan nobody created from the integration | Someone built it in a chat. It's the same plan.created event; decide in your handler whether such plans are imported or wait for review. |
Still stuck? Write to developers@routal.com. The MCP server shares the API's rate limit (2,000 requests/min per organization). See Rate limits.
