SSE.ConnectionPlug (MCP SSE v0.1.5)
View SourceA Plug for handling Server-Sent Events (SSE) connections with MCP protocol support.
Query params:
sessionId
- The session ID for the connection
This plug provides two endpoints:
/sse
- Establishes the SSE connection/message
- Handles JSON-RPC messages for the MCP protocol
Usage in Phoenix Router
pipeline :sse do
plug :accepts, ["sse"]
end
scope "/" do
pipe_through :sse
get "/sse", SSE.ConnectionPlug, :call
post "/message", SSE.ConnectionPlug, :call
end
Usage in Plug Router
forward "/sse", to: SSE.ConnectionPlug
forward "/message", to: SSE.ConnectionPlug