Server-Sent Events transport implementation for Model Context Protocol enabling real-time, one-way server-to-client communication with JSON-RPC message handling and seamless integration in the Bun runtime.
Unlock the full potential of Bun SSE Transport for MCP through LangDB's AI Gateway. Get enterprise-grade security, analytics, and seamless integration with zero configuration.
Free tier available • No credit card required
A Server-Sent Events (SSE) transport implementation for the Model Context Protocol (MCP) using Bun.
This package provides a Bun-specific implementation of SSE transport for MCP servers. It enables real-time, one-way communication from server to client using the SSE protocol, with client-to-server communication handled via HTTP POST requests.
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; import { BunSSEServerTransport } from "bun-mcp-sse-transport"; // Create SSE transport const transport = new BunSSEServerTransport("/messages"); // Connect to MCP server const server = new McpServer({ name: "MyServer", version: "1.0.0" }); server.connect(transport); // Set up Bun HTTP server Bun.serve({ port: 3000, routes: { "/sse": () => transport.createResponse(), "/messages": (req) => transport.handlePostMessage(req) } });
/sse
, the server creates an SSE connectionThis implementation follows the MCP standard while leveraging Bun's streaming capabilities for efficient real-time communication.
Discover shared experiences
Shared threads will appear here, showcasing real-world applications and insights from the community. Check back soon for updates!