Server-Sent Events (SSE) transport layer for MCP.
Provides two endpoints:
- GET /sse - Server-Sent Events stream for server-to-client messages
- POST /message - HTTP endpoint for client-to-server messages
Options
:server_module(required) - The MCP server module to route requests to:cors_origin- CORS allow-origin header (default: "*"):cors_methods- CORS allow-methods header (default: "GET, POST, OPTIONS"):cors_headers- CORS allow-headers header (default: "content-type, authorization"):auth- Authentication plug configuration (optional)
Example
{Bandit,
plug: {ConduitMcp.Transport.SSE,
server_module: MyApp.MCPServer,
cors_origin: "https://myapp.com"},
port: 4001}With Authentication
{Bandit,
plug: {ConduitMcp.Transport.SSE,
server_module: MyApp.MCPServer,
auth: [
strategy: :bearer_token,
token: "my-secret-token"
]},
port: 4001}
Summary
Functions
Callback implementation for Plug.call/2.
Callback implementation for Plug.init/1.