v1

latestOpenAPI 3.1.0raw.githubusercontent.com2026-06-304917042.1 MB
mcp-chat

Stream an LLM chat turn that uses the MCP server as its toolbelt

SSE stream of one chat turn.

The LLM (Claude) sees every tool registered on our MCP server. When the model wants a tool, we dispatch it via mcp.call_tool — same code path as remote MCP clients hitting /mcp/ — and feed the result back. end_user_id (optional) pins all end-user-scoped tool calls to that contact.

The endpoint streams an event-stream of:

  • text_delta — incremental assistant text (append to the bubble).
  • tool_call — model decided to call a tool (name, input).
  • tool_result — JSON-string result (or error).
  • turn_end — one Claude turn finished (may loop again for tools).
  • done — full turn complete.
  • error — fatal; stream closes.

No RBAC dependency on this endpoint itself — tools enforce their own permissions via the @cx_tool registry, so a viewer-role caller chatting here can only invoke the read tools.

post/v1/mcp-chat/stream

Request body

end_user_idstring uuid nullable
modelstring

Chat completions model identifier (OpenAI).

max_tokensinteger

Response

Successful Response