You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be a bit neater if I could do something like:
// On the local serverconstserverReady=await// boot something locally or get an auth token for remoteconstproxy=newTransportProxy()constlocalTransport=newStdioServerTransport()constwsTransport=newWebsocketTransport({url: serverReady.wssUrl})awaitproxy.connect(localTransport,wsTransport)
// Inside the worker
const webSocketPair = new WebSocketPair();
const client = webSocketPair[0], server = webSocketPair[1];
const transport = new WebsocketTransport({ connection: server })
this.ctx.waitUntil(server.connect(transport))
return new Response(null, {
status: 101,
webSocket: client,
});
The issue with making this completely generic is being able to establish the websocket in a secure way. I can see the advantage of stdin/stdout in that respect! But I thought I'd raise the issue to see if there'd been interest in using websockets like this?
Describe alternatives you've considered
Making Claude Desktop config allow a "websocket" URL instead of a "command", and a "headers" field instead of "args" for auth? That sounds like the end goal, but this might be a good stopgap.
Additional context
I am also not sure if @modelcontextprotocol/sdk works out of the box in Cloudflare Workers, but that should be a fairly easy fix.
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
Experimenting with writing MCP Servers in Cloudflare Workers/Durable Objects. Currently doing a simple pivot from stdin/stderr to HTTP, e.g.
Describe the solution you'd like
It would be a bit neater if I could do something like:
The issue with making this completely generic is being able to establish the websocket in a secure way. I can see the advantage of stdin/stdout in that respect! But I thought I'd raise the issue to see if there'd been interest in using websockets like this?
Describe alternatives you've considered
Making Claude Desktop config allow a
"websocket"
URL instead of a"command"
, and a"headers"
field instead of"args"
for auth? That sounds like the end goal, but this might be a good stopgap.Additional context
I am also not sure if
@modelcontextprotocol/sdk
works out of the box in Cloudflare Workers, but that should be a fairly easy fix.The text was updated successfully, but these errors were encountered: