
mcp server do
**摘要:** MCP Server DO 是一个基于SSE的可扩展通信服务,使用Durable Objects支持如聊天和仪表盘等实时应用。设置简单,适合生产环境使用。
Repository Info
About This Server
**摘要:** MCP Server DO 是一个基于SSE的可扩展通信服务,使用Durable Objects支持如聊天和仪表盘等实时应用。设置简单,适合生产环境使用。
Model Context Protocol (MCP) - This server can be integrated with AI applications to provide additional context and capabilities, enabling enhanced AI interactions and functionality.
Documentation
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 installnpm startto start the DO (athttp://localhost:8787)npx @modelcontextprotocol/inspectorto 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?
Quick Start
Clone the repository
git clone https://github.com/irvinebroque/mcp-server-doInstall dependencies
cd mcp-server-do
npm installFollow the documentation
Check the repository's README.md file for specific installation and usage instructions.
Repository Details
Recommended MCP Servers
Discord MCP
Enable AI assistants to seamlessly interact with Discord servers, channels, and messages.
Knit MCP
Connect AI agents to 200+ SaaS applications and automate workflows.
Apify MCP Server
Deploy and interact with Apify actors for web scraping and data extraction.
BrowserStack MCP
BrowserStack MCP Server for automated testing across multiple browsers.
Zapier MCP
A Zapier server that provides automation capabilities for various apps.