Enables real-time communication between client and server using Server-Sent Events (SSE) for the Model Context Protocol, specifically built for the Bun JavaScript runtime.
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!