Fire in da houseTop Tip:Paying $100+ per month for Perplexity, MidJourney, Runway, ChatGPT and other tools is crazy - get all your AI tools in one site starting at $15 per month with Galaxy AI Fire in da houseCheck it out free

cf-mcp-durable-object

MCP.Pizza Chef: gingerhendrix

cf-mcp-durable-object is a proof-of-concept MCP server implementation that runs on Cloudflare Durable Objects, leveraging Websockets for real-time, scalable communication. It acts as a bridge between agents and the Durable Object server via a proxy using JSON stdio transport, enabling efficient context sharing and interaction in distributed environments. This server is ideal for deploying MCP infrastructure on Cloudflare's edge network with easy deployment and testing tools.

Use This MCP server To

Deploy MCP server on Cloudflare edge for low-latency context access Enable real-time model context exchange via Websockets Proxy MCP agent connections to Durable Object servers Test MCP server implementations with mcp inspector tool Run scalable MCP servers with Cloudflare Durable Objects Integrate MCP servers into distributed edge workflows

README

MCP over Websockets on Cloudflare Durable Objects

This is a proof of concept Model Context Protocol (MCP) server running on a Cloudflare Durable Object.

The agent connects to the DO Server via a proxy using the JSON stdio transport, which is then forwarded to the DO Server via Websockets.

Agent <-stdio-> Proxy <-ws-> DO Server

Usage

  • Deploy to CloudFlare with npm run deploy.
  • Run the proxy server with npx tsx src/client.ts wss://my-durable-object.foo.workers.dev.
  • Use mcp inspector to test the server npx -y @modelcontextprotocol/inspector npx -y tsx src/client.ts wss://...

cf-mcp-durable-object FAQ

How do I deploy cf-mcp-durable-object to Cloudflare?
Use the command `npm run deploy` to deploy the server to Cloudflare Durable Objects.
How does the proxy server interact with the Durable Object server?
The proxy uses JSON stdio transport to communicate with the agent and forwards messages to the Durable Object server via Websockets.
Can I test the MCP server locally before deployment?
Yes, you can run the proxy server locally with `npx tsx src/client.ts wss://your-durable-object-url` and use the mcp inspector tool for testing.
What transport protocols does cf-mcp-durable-object support?
It supports JSON stdio transport between agent and proxy, and Websockets between proxy and Durable Object server.
Is cf-mcp-durable-object suitable for production use?
It is currently a proof of concept but can be adapted for production with further development and testing.
What advantages do Cloudflare Durable Objects provide for MCP servers?
They offer scalable, low-latency, and stateful edge compute capabilities ideal for MCP context management.
Which LLM providers can integrate with this MCP server?
It is provider-agnostic and can work with OpenAI, Anthropic Claude, and Google Gemini models.