SSE + MCP Server + Durable Objects
by irvinebroque
This project implements an SSE transport layer and an MCP server as a Durable Object, designed to work with `@modelcontextprotocol/typescript-sdk`. It provides a way to run an MCP server using Durable Objects in a Workers environment.
Last updated: N/A
What is SSE + MCP Server + Durable Objects?
This is an implementation of an MCP server using Cloudflare Durable Objects, with an SSE transport layer adapted for the Workers environment. It aims to replicate the functionality of the @modelcontextprotocol/typescript-sdk
example within a Durable Objects context.
How to use SSE + MCP Server + Durable Objects?
- Clone the repository. 2. Run
npm install
. 3. Runnpm start
to start the Durable Object server (athttp://localhost:8787
). 4. Runnpx @modelcontextprotocol/inspector
to start the MCP inspector. 5. Open the inspector and enterhttp://localhost:8787/sse
to connect.
Key features of SSE + MCP Server + Durable Objects
SSE Transport Layer for Workers
MCP Server as a Durable Object
Compatibility with @modelcontextprotocol/typescript-sdk
Easy setup and deployment
Mirrors existing SDK example
Use cases of SSE + MCP Server + Durable Objects
Running MCP servers in a serverless environment
Building real-time applications with Model Context Protocol
Experimenting with Durable Objects and SSE
Integrating MCP with Cloudflare Workers
FAQ from SSE + MCP Server + Durable Objects
What is MCP?
What is MCP?
Model Context Protocol (MCP) is a protocol for managing and sharing models in a distributed environment.
What are Durable Objects?
What are Durable Objects?
Durable Objects are a serverless compute primitive offered by Cloudflare, providing stateful execution in a globally distributed network.
What is SSE?
What is SSE?
Server-Sent Events (SSE) is a server push technology enabling real-time data streaming from a server to a client.
Why use Durable Objects for an MCP server?
Why use Durable Objects for an MCP server?
Durable Objects provide a scalable and cost-effective way to run stateful applications like MCP servers in a serverless environment.
How does this differ from the standard @modelcontextprotocol/typescript-sdk example?
How does this differ from the standard @modelcontextprotocol/typescript-sdk example?
This implementation adapts the SDK example to run within a Cloudflare Workers environment using Durable Objects, which requires a custom SSE transport layer.