I craft unique cereal names, stories, and ridiculously cute Cereal Baby images.

SSE + MCP Server + Durable Objects
- A SSE Transport layer that works with
@modelcontextprotocol/typescript-sdk
(/src/sse.ts
) - A MCP Server as a Durable Object (
/src/mcp-server-do.ts
) - Steps to run it end-to-end
Run it
- Clone this repo
-
npm install
-
npm start
to start the DO (athttp://localhost:8787
) -
npx @modelcontextprotocol/inspector
to run the MCP inspector - Open the inspector, enter
http://localhost:8787/sse
You should see:
Details
I took this example from @modelcontextprotocol/typescript-sdk
:
import express from "express";
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
import { SSEServerTransport } from "@modelcontextprotocol/sdk/server/sse.js";
const server = new McpServer({
name: "example-server",
version: "1.0.0"
});
// ... set up server resources, tools, and prompts ...
const app = express();
app.get("/sse", async (req, res) => {
const transport = new SSEServerTransport("/messages", res);
await server.connect(transport);
});
app.post("/messages", async (req, res) => {
// Note: to support multiple simultaneous connections, these messages will
// need to be routed to a specific matching transport. (This logic isn't
// implemented here, for simplicity.)
await transport.handlePostMessage(req, res);
});
app.listen(3001);
...and implemented the same thing in Durable Objects. But first needed a transport layer that worked on Workers.
Following sse.ts
from @modelcontextprotocol/typescript-sdk
, I made one, trying to mirror the shape of the existing one. Some pretty fundamental assumptions baked into the SDK around its use of node:http
that leak out beyond the SSE transport through its input types — but really the only meaningful interface change is that handlePostMessage
takes a request and returns a response. Seems like there's probably a clever way somehow to upstream?
相关推荐
I find academic articles and books for research and literature reviews.
Evaluator for marketplace product descriptions, checks for relevancy and keyword stuffing.
Confidential guide on numerology and astrology, based of GG33 Public information
Emulating Dr. Jordan B. Peterson's style in providing life advice and insights.
Your go-to expert in the Rust ecosystem, specializing in precise code interpretation, up-to-date crate version checking, and in-depth source code analysis. I offer accurate, context-aware insights for all your Rust programming questions.
Advanced software engineer GPT that excels through nailing the basics.
Converts Figma frames into front-end code for various mobile frameworks.
Discover the most comprehensive and up-to-date collection of MCP servers in the market. This repository serves as a centralized hub, offering an extensive catalog of open-source and proprietary MCP servers, complete with features, documentation links, and contributors.
The all-in-one Desktop & Docker AI application with built-in RAG, AI agents, No-code agent builder, MCP compatibility, and more.
Micropython I2C-based manipulation of the MCP series GPIO expander, derived from Adafruit_MCP230xx
Fair-code workflow automation platform with native AI capabilities. Combine visual building with custom code, self-host or cloud, 400+ integrations.
Mirror ofhttps://github.com/agentience/practices_mcp_server
🧑🚀 全世界最好的LLM资料总结(Agent框架、辅助编程、数据处理、模型训练、模型推理、o1 模型、MCP、小语言模型、视觉语言模型) | Summary of the world's best LLM resources.
Reviews

user_8hUUOhdm
The Trellis MCP Server by FishWoWater is impressive! It offers seamless integration and an intuitive interface, making it a must-have for any MCP application user. Its robust performance and reliable security features ensure smooth operation. Highly recommend giving it a try through their link!