Agent API
The fOS MCP server at mcp.tovr.eu and its REST bridge. Endpoints, sessions, API keys, OAuth, scopes, credits, connected integrations and error responses.
External assistants reach fOS through an MCP server that speaks Streamable HTTP, and through a REST bridge for clients without MCP.
| Environment | Host |
|---|---|
| Production | https://mcp.tovr.eu |
| Staging | https://mcp-staging.tovr.eu |
Endpoints
| Endpoint | Purpose |
|---|---|
POST /mcp | MCP messages. The first request without Mcp-Session-Id opens a session. |
GET /mcp, DELETE /mcp | Stream and close an existing session, with Mcp-Session-Id |
GET /api/v1/tools | REST bridge: the tools your token can call |
POST /api/v1/tools/{toolName} | REST bridge: call one tool with a JSON body |
GET /openapi.json | The bridge's OpenAPI document |
GET /health | {"status":"ok","service":"fos-mcp",…}, no authentication |
/.well-known/oauth-protected-resource, /.well-known/oauth-authorization-server | OAuth discovery |
POST /oauth/register, GET /oauth/authorize, POST /oauth/token | OAuth endpoints |
Sessions
| Rule | Value |
|---|---|
| Where they live | In the server's memory. A restart ends every session. |
Unknown or ended Mcp-Session-Id | 404 "Session not found". Open a new session. |
A GET or DELETE without a session | 400 "Session required" |
| Organization | From the token, else from your memberships. Change it with switch_org. |
| Tool language | Read once per session from your user's language |
| Browser origins | claude.ai, chatgpt.com, chat.openai.com, gemini.google.com, www.perplexity.ai and TOVR's own hosts. A request without Origin is allowed. |
Credentials
Send Authorization: Bearer <token>. The token is one of two kinds.
| Kind | Form | Where it comes from |
|---|---|---|
| API key | tovr_… | Settings → Developer → API keys, shown once. Its scopes and organization are fixed on the key. |
| OAuth access token | A JWT, valid for 3,600 seconds | The OAuth flow below |
OAuth
| Step | Rule |
|---|---|
| Registration | POST /oauth/register (dynamic client registration). A registered client expires after 30 days. Without scope it gets read write; an unknown scope is refused. |
| Authorization | GET /oauth/authorize with PKCE S256 only. Without scope it asks for read. It sends you to TOVR's Authorize page, where you pick the organization and select Approve. |
| Code | Valid for 5 minutes |
| Token | POST /oauth/token with grant_type authorization_code or refresh_token |
| Refresh token | Valid for 90 days. Each use returns a new one and ends the old one. |
Scopes
| Scope | Built-in tools |
|---|---|
read | The 19 read tools listed in Tool reference |
write | The read tools and report_vehicle_available, request_direct_offer, confirm_win |
| either | list_my_orgs, switch_org |
A call to a built-in tool outside your scopes is refused: 403 on the bridge.
Connected integrations
When your organization has connected Gmail, Google Calendar, Google Drive or another fOS App, tools from it are listed next to the built-in tools of your MCP session. A tool set to Deny in Tool permissions is never listed. The REST bridge offers only the built-in tools. If TOVR cannot read an integration's credentials, that integration adds no tools. If its token cannot be refreshed, the integration is marked as needing action in Integrations.
Credits
Each MCP tool call costs 5 credits of your organization's fOS plan, charged before the tool runs,
so a call that is then refused is charged too. Listing the tools over MCP is free. On the REST
bridge, every request under /api/v1 costs 5 credits, including GET /api/v1/tools. See
Credits and plans.
Errors
| Situation | MCP | REST bridge |
|---|---|---|
| Missing or invalid token | 401 with WWW-Authenticate: Bearer resource_metadata="…/.well-known/oauth-protected-resource", error="invalid_token" | 401 |
| Credits used up | A tool result with isError and the text "fOS usage limit reached — upgrade your fOS plan or buy credits to continue." | 402 with error, reason, resetAt, upgradable |
| Tool outside your scopes | A refusal result | 403 |
| Unknown tool | A tool result with isError and "Tool not found" | 403, because the scope check runs first. 404 only for a name your scopes cover that the bridge does not offer, such as switch_org. |
| Body is not JSON | 400 | |
| The tool returned an error | The tool's error result | 200 with success: false and error |
| The tool threw | A tool result with isError | 500 |
There is no per-minute rate limit on this server; usage is bounded by credits.
Related
Session and context
The fOS tools that ask for missing details, show maps, dashboards and exports, connect integrations, sign a carrier in on the bot, and pick the organization for an external assistant.
Credits and plans
How fOS usage is counted in credits, the limits of each fOS plan, the order in which limits apply, and the 402 response when a limit is reached.