Skip to content

Commit ef175af

Browse files
committed
Add message sse
Signed-off-by: Marcos Candeia <[email protected]>
1 parent 671d23e commit ef175af

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

deno.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@deco/mcp",
3-
"version": "0.1.15",
3+
"version": "0.1.16",
44
"exports": "./mod.ts",
55
"tasks": {
66
"check": "deno fmt && deno lint && deno check mod.ts"

mcp/server.ts

+5-2
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,8 @@ export function mcpServer<TManifest extends AppManifest>(
239239
const path = new URL(c.req.url).pathname;
240240

241241
if (
242-
path === `${options?.basePath ?? ""}/mcp/ws` && c.req.raw.headers.get("upgrade") === "websocket"
242+
path === `${options?.basePath ?? ""}/mcp/ws` &&
243+
c.req.raw.headers.get("upgrade") === "websocket"
243244
) {
244245
const { response, socket } = Deno.upgradeWebSocket(c.req.raw);
245246

@@ -252,7 +253,9 @@ export function mcpServer<TManifest extends AppManifest>(
252253
}
253254

254255
if (path === `${options?.basePath ?? ""}/mcp/sse`) {
255-
const transport = new SSEServerTransport(MESSAGES_ENDPOINT);
256+
const transport = new SSEServerTransport(
257+
`${options?.basePath ?? ""}${MESSAGES_ENDPOINT}`,
258+
);
256259
transports.set(transport.sessionId, transport);
257260

258261
transport.onclose = () => {

0 commit comments

Comments
 (0)