SSE + MCP Server + Durable Objects logo

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.

View on GitHub

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?

  1. Clone the repository. 2. Run npm install. 3. Run npm start to start the Durable Object server (at http://localhost:8787). 4. Run npx @modelcontextprotocol/inspector to start the MCP inspector. 5. Open the inspector and enter http://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?

Model Context Protocol (MCP) is a protocol for managing and sharing models in a distributed environment.

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?

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?

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?

This implementation adapts the SDK example to run within a Cloudflare Workers environment using Durable Objects, which requires a custom SSE transport layer.