SSE Transport
The Naive MCP server uses Server-Sent Events (SSE) transport. This is a standard HTTP connection that stays open for bidirectional communication.Connecting
1
Get an API key
Register at
POST /v1/auth/register or use an existing key.2
Connect SSE
Open a connection to:The server responds with a session event containing a
sessionId.3
Send messages
Client Configuration Examples
- Claude Desktop
- Cursor
- Custom Client
Add to
claude_desktop_config.json:Two SSE endpoints
There are two ways to open a session, and they scope differently.Selecting a subject: X-Naive-User-Id
MCP has no /v1/users/{user_id}/… path, so the header is how a connection names a
subject other than the default — the same header, the same validation and the same
refusals as on every REST route (see Subject resolution).
Set it alongside Authorization in your client config:
POST as well as the SSE connect — clients that re-send
Authorization per message must re-send this too, or the message is refused as a
different identity than the one that opened the session.
The per-user form is what every multi-tenant integration should use. Mint it with
POST /v1/users/{user_id}/sessions, which returns the /mcp/sse/{session_id} URL; the
nv_sess_… token still travels in the Authorization header. GET /v1/users/{user_id}/sessions/{id}/tools
shows exactly which tools that session will be offered, before you connect.
Session Lifecycle
- Sessions are tied to the SSE connection
- When connection drops, the session ends
- Each new connection creates a new session
- The server sends an SSE comment frame (
:) every 25 seconds so an idle stream is not closed by an intermediary. You do not need to send anything to hold the session open, and your client should ignore comment frames (every standard SSE parser already does) - If the stream does drop, the next
POST /mcp/messagesanswers404 {"error":{"code":"session_expired"}}. That code means reconnect and replay — the resource you named is unaffected. It is deliberately distinct fromresource_not_found, which means the inbox/app/deployment you asked about does not exist - Auth is validated when the SSE connection opens
- On
POST /mcp/messages, anAuthorizationheader that is present and does not match the identity that opened the session is rejected with401. An absent header is accepted and falls back to the session binding, because many MCP clients only authenticate the SSE connect and requiring it per message would 401 every tool call - The tool list is assembled once, at connect time, from the resolved tenant’s Account Kit. A kit edit mid-session does not retract a listed tool; the execution gate still denies it. Reconnect to refresh