SmartRoutes MCP Server

SmartRoutes MCP Server

Enables AI assistants to interact with SmartRoutes route optimization and dispatch tools, allowing users to manage orders, vehicles, and plans via natural language.

Category
访问服务器

README

SmartRoutes MCP Server

Expose your SmartRoutes route-optimisation and dispatch tools to AI assistants like Claude Desktop, Claude Code, Cursor, Windsurf, and any other Model Context Protocol client — working against your live data.

Overview

The MCP server connects an AI tool to your live SmartRoutes account. Ask your AI Assistant which orders are still unscheduled, review a route plan, or kick off an optimisation — all in chat, against your real data.

It exposes the same operations as the SmartRoutes REST API, shaped as clean tools an agent can call directly. Everything is scoped to a single account by your API key.

Available Tools

Tool Type Description
list_orders Read Orders for the depot (filter by date/status; paginated)
get_order Read Full detail for a single order
add_order Write Create a new order (pickup, delivery, or shipment)
check_booking_availability Read Whether a time window + address can be served
optimise_plan_for_date Write Trigger route optimisation for a date
get_optimisation_status Read Poll an optimisation job until it finishes
get_plan Read Plan-level totals and route summary for a date
get_route Read Per-stop detail for a single route
list_vehicles Read Fleet vehicles with shifts, capacities, and skills
get_vehicle Read Full detail for a single vehicle
list_customers Read Customers for the depot

Write tools come with a confirmation step. The assistant explains what it's about to do and waits for your approval — especially optimise_plan_for_date with auto-dispatch, which publishes the plan to drivers and notifies customers.

Setup

1. Get your API key

The MCP server uses your existing SmartRoutes API key — the same x-access-key you already use for the REST API.

To generate an API Key, login to your SmartRoutes account and go to Settings > Integrations > SmartRoutes Open API and click on the Generate API Key button.

Treat the key as a secret; it grants access to your account's data.

2. Connect your AI tool

Ready-to-copy config files for every client live in examples/ — drop in your key and go.

Quick start (Claude Code)

This repo includes a pre-configured .mcp.json. Just replace <your-api-key>:

{
  "mcpServers": {
    "smartroutes": {
      "type": "http",
      "url": "https://mcp.smartroutes.io/mcp",
      "headers": {
        "x-access-key": "<your-api-key>"
      }
    }
  }
}

Claude Code auto-discovers this file when you open the project.

Claude Desktop

Add a Custom Connector for SmartRoutes by going to: Settings → Connectors → Add custom connector

Here you can add the following details:

  • Name: SmartRoutes (or whatever you like)
  • URL: https://mcp.smartroutes.io/mcp

Add your authentication header under Advanced settings / Request headers in that same dialog:

  • Key: x-access-key
  • Value: your actual API key

Alternatively, you can add the following to your Claude Desktop config (claude_desktop_config.json):

{
  "mcpServers": {
    "smartroutes": {
      "url": "https://mcp.smartroutes.io/mcp",
      "headers": {
        "x-access-key": "<your-api-key>"
      }
    }
  }
}

Cursor

In Cursor settings, add an MCP server:

  • Name: smartroutes
  • Type: Streamable HTTP
  • URL: https://mcp.smartroutes.io/mcp
  • Headers: x-access-key: <your-api-key>

Windsurf

Add to your Windsurf MCP config (mcp_config.json):

{
  "mcpServers": {
    "smartroutes": {
      "serverUrl": "https://mcp.smartroutes.io/mcp",
      "headers": {
        "x-access-key": "<your-api-key>"
      }
    }
  }
}

Any MCP Client (generic)

The server uses Streamable HTTP transport:

POST https://mcp.smartroutes.io/mcp
x-access-key: <your-api-key>

Any MCP client that speaks Streamable HTTP can connect. Legacy SSE clients are handled automatically.

3. Local development

Against a locally-running server the endpoint is (use whatever port your local app listens on):

http://localhost:3000/mcp-api

Example Conversations

Once connected, you can ask your assistant things like:

  • "What orders for tomorrow aren't on a route yet?"
  • "Show me available vehicles and their shifts."
  • "Can we fit a delivery to 12 Main St between 2–4pm on Friday?"
  • "Optimise tomorrow's routes for all open orders — draft only, don't dispatch yet."
  • "What's the status of that optimisation?"
  • "Show me the plan for 2026-07-01 and the stops on route 3."
  • "Add a 10 kg delivery for ACME at 5 King St."

API Key Management

Your MCP key is your SmartRoutes API key.

Action Description
Use The same x-access-key as the REST API; scoped to one depot.
Disable Disabling a key in your SmartRoutes account immediately blocks both MCP and REST access.

Security

  • Authentication: API key in the x-access-key header.
  • Depot isolation: every key is scoped to a single depot, and all data is filtered by depot.
  • Rate limiting: each tool has its own per-key rate limit (shared with the REST API's limits).
  • Write confirmation: write tools (add_order, optimise_plan_for_date) instruct the assistant to explain and confirm before running — especially auto-dispatch.

How it works

The MCP server runs the same engine as the SmartRoutes REST API — each tool calls the same underlying service, so MCP and the API always agree on behaviour and data. Transport is Streamable HTTP; authentication is your API key.

A typical "plan tomorrow's routes" flow:

  1. list_orders / list_vehicles — see what's available
  2. check_booking_availability — confirm a slot (optional)
  3. add_order — enter new work
  4. optimise_plan_for_date — build the plan (confirm before auto-dispatch)
  5. get_optimisation_status — poll until it finishes
  6. get_plan / get_route — read the result

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选