fOS Agent API
The developer interface to fOS at mcp.tovr.eu — connect an external assistant over the Model Context Protocol or the REST bridge, authenticate with an API key or OAuth 2.1 (DCR + PKCE), scope access read/write, and call fOS tools.
The fOS Agent API lets an external AI assistant (Claude, ChatGPT, and other MCP clients)
drive fOS's tools. It lives at mcp.tovr.eu and speaks the
Model Context Protocol (MCP) over Streamable HTTP, with a plain-REST bridge for non-MCP
clients. Shared conventions (bearer format, errors) are in API conventions;
the surface model is in Surfaces.
MCP endpoint
https://mcp.tovr.eu/mcpTransport is Streamable HTTP with stateful sessions keyed by an Mcp-Session-Id header.
| Call | Effect |
|---|---|
POST /mcp (no session id) | Create a session; returns Mcp-Session-Id. |
POST /mcp (with session id) | Send a message to an existing session. |
GET /mcp (with session id) | Open an SSE stream for server-sent events. |
DELETE /mcp (with session id) | Close the session. |
Sessions re-validate the caller's authentication every 10 tool calls. Allowed browser origins
include claude.ai, chatgpt.com / chat.openai.com, gemini.google.com, perplexity.ai,
and TOVR's own hosts.
Authentication
Every request carries a bearer token, which is one of two things:
Authorization: Bearer <token>- API key — a long-lived key of the form
tovr_…, issued to a developer/integration. Simplest for server-to-server use. - OAuth 2.1 access token — for MCP clients that authenticate a user via the browser flow below.
OAuth 2.1
The server advertises its configuration for auto-discovery:
GET https://mcp.tovr.eu/.well-known/oauth-authorization-server{
"issuer": "https://mcp.tovr.eu",
"authorization_endpoint": "https://mcp.tovr.eu/oauth/authorize",
"token_endpoint": "https://mcp.tovr.eu/oauth/token",
"registration_endpoint": "https://mcp.tovr.eu/oauth/register",
"grant_types_supported": ["authorization_code", "refresh_token"],
"code_challenge_methods_supported": ["S256"],
"scopes_supported": ["read", "write"]
}The flow is standard OAuth 2.1 with PKCE:
- Dynamic client registration —
POST /oauth/registerwithredirect_urisand aclient_namereturns aclient_id. DCR clients are valid for 30 days; major platforms are pre-registered. - Authorize —
GET /oauth/authorizewithclient_id,redirect_uri,scope,state, and acode_challenge(S256). This redirects to the TOVR consent page; on approval it redirects back with a single-use authorization code (a short-lived JWT). - Token —
POST /oauth/tokenwithgrant_type=authorization_code, thecode, and the PKCEcode_verifier, returns an access token (expires_in3600) and a refresh token.
{
"access_token": "<jwt>",
"token_type": "Bearer",
"expires_in": 3600,
"refresh_token": "<uuid>",
"scope": "read write"
}Refresh tokens are opaque, have a 90-day TTL, and rotate on use (each use issues a new one and
invalidates the old — replay is rejected). Access tokens carry the user's identity and granted
scope; the active organization is resolved with
list_my_orgs / switch_org.
Scopes
Access splits into read (queries) and write (state-changing actions). Request the
narrowest scope you need. On this surface, read tools are broadly exposed, write tools are
gated, and some sensitive actions are not exposed at all — see
Guardrails › scoped exposure
and the per-category tables for each tool's MCP flag.
REST bridge
For clients that don't speak MCP, the same tools are available over plain REST:
| Endpoint | Purpose |
|---|---|
GET /api/v1/tools | List the available tools and their schemas. |
POST /api/v1/tools/{toolName} | Invoke a tool with a JSON argument body. |
GET /openapi.json | The generated OpenAPI description of the tool surface. |
Authentication and scopes are identical to the MCP endpoint.
Rate limits & health
Requests are rate-limited per authenticated caller (429 on exceed; standard
rate-limit headers). GET /health is an unauthenticated
liveness check.
Which tools are available
The tools exposed here are the ones flagged MCP ✓ in the per-category reference — chiefly the decision-grade reads (fleet, economics) plus a controlled set of actions. Start from the tool arsenal.
Session & context
fOS plumbing tools — org scoping for external assistants (list/switch companies), asking the user for a missing detail, exporting data, connecting an integration, and the carrier auth tools for non-web surfaces.
Knowledge Base
Short, task-oriented answers for carriers and dispatchers using TOVR - getting started, connecting a load board, and how matching works.