Skip to main content
Glama
tigranbs

Bun SSE Transport for MCP

by tigranbs

bun-mcp-sse-传输

使用 Bun 的模型上下文协议 (MCP) 的服务器发送事件 (SSE) 传输实现。

概述

此软件包为 MCP 服务器提供了 Bun 特有的 SSE 传输实现。它使用 SSE 协议实现从服务器到客户端的实时单向通信,并通过 HTTP POST 请求处理客户端到服务器的通信。

Related MCP server: MCP Server with SSE and Bearer Authentication

主要特点

  • 专为 Bun 运行时构建

  • 实现 MCP 传输接口

  • 使用适当的标头管理 SSE 连接

  • 处理传入的 JSON-RPC 消息

  • 与 Bun.serve 简单集成

快速使用

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)
  }
});

工作原理

  1. 当客户端连接到/sse时,服务器会创建一个 SSE 连接

  2. 服务器发送客户端应该 POST 消息的端点 URL

  3. 客户端向端点 URL 发送 JSON-RPC 消息

  4. 服务器接收这些消息并将其传递给 MCP 服务器

  5. MCP 服务器处理消息并通过 SSE 连接发送响应

该实现遵循 MCP 标准,同时利用 Bun 的流媒体功能实现高效的实时通信。

F
license - not found
Not graded
quality - not tested
D
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    Not graded
    quality
    D
    maintenance
    Implements a Model Context Protocol server using Server-Sent Events for real-time communication with OAuth 2.1 integration via Ory Network, enabling secure AI model communication with authentication and client management.
    Apache 2.0
  • -
    license
    Not graded
    quality
    Not graded
    maintenance
    A TypeScript implementation of a Model Context Protocol server that uses Server-Sent Events for real-time communication and Bearer Token authentication to enable secure interaction with LLM clients like Claude Desktop.
  • -
    license
    Not graded
    quality
    Not graded
    maintenance
    A TypeScript implementation of a Model Context Protocol server that enables real-time communication with LLM clients using Server-Sent Events (SSE) for transport and Bearer Token authentication for security.

View all related MCP servers

Related MCP Connectors

  • A Model Context Protocol server for Wix AI tools

  • A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…

  • Connect AI agents to Replynodes over the Model Context Protocol.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/tigranbs/bun-mcp-sse-transport'

If you have feedback or need assistance with the MCP directory API, please join our Discord server