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
- The document declares no server URL.
- AuthAPI key in header x-api-key
- TypeScriptA function with typed inputs. Its response is checked against the schema.
Request body
Response
Successful Response
Changes
No recorded changes to this operation across all 3 revisions of this API.