Realtime MCPs #668
Replies: 3 comments
-
|
yeah, that looks good. if the server advertises its resource capabilities, we should allow this connection type. |
Beta Was this translation helpful? Give feedback.
-
|
SSE feels like the best starting point here. It’s simpler, works great for one-way updates, auto-reconnects, and aligns with Cloudflare’s existing patterns. WebSocket would be a solid future upgrade for multiplexing and bi-directional flows, but it brings more client/server complexity (reconnects, custom protocols). Also, it would be awesome if the MCP could advertise whether a tool supports realtime (maybe via metadata). The client hook could then auto-upgrade to live mode when available. Overall, I love this idea, makes AI feel like I'm using Figma or Slack or Notion. PS: Strongly recommend defining a clear tool ↔ entity invalidation map so the Durable Object knows what to broadcast. |
Beta Was this translation helpful? Give feedback.
-
|
What's the "Convex-like" DX for MCP apps? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I believe there is some way that you can toggle a "realtime mode" in an MCP, and then when you do this, the URL of the MCP starts to be kind of a proxy to some cloudflare durable object we put on top of it and we add realtime capabilities.
So, this enables us to configure the entity/revalidation relationship between tools.
And then our Worker can be connected to in a Convex-like DX. I can easily then generate/create views that are realtime.
Pseudo code:
Assumptions / Ideas Behind This Pseudocode:
useToolQuery(toolPath: string, input: object):
Connects to a Durable Object websocket behind the MCP’s new realtime proxy mode.
Automatically revalidates on updates, similar to Convex's useQuery.
useToolMutation(toolPath: string):
Returns a function that executes a tool call (e.g. via fetch or internal protocol).
The server knows which queries are invalidated by which mutations based on the entity revalidation config.
Durable Object (or internal system) does:
Tracks subscriptions.
Pushes updates over websocket.
Invalidates and resends when a mutation affects a tool’s result set.
Beta Was this translation helpful? Give feedback.
All reactions