Skip to content

Commit f07f054

Browse files
committed
Remove SSE endpoint check entirely - always return marketing page for GET
- Simplifies GET request handling - Avoids any potential issues with SSE endpoint negotiation - Forces clients to use POST for all MCP requests - Should resolve hanging tool call issues
1 parent 8b3cc5e commit f07f054

File tree

1 file changed

+3
-19
lines changed

1 file changed

+3
-19
lines changed

src/index.ts

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -62,30 +62,14 @@ export default {
6262
// Session termination
6363
return new Response(null, { status: 204, headers: addCorsHeaders() })
6464
} else if (request.method === 'GET') {
65-
// Check if this is an MCP client requesting SSE or regular browser
66-
const acceptHeader = request.headers.get('Accept') || ''
67-
const sessionId = request.headers.get('Mcp-Session-Id')
68-
69-
// MCP client requesting SSE - SSE is optional in Streamable HTTP protocol
70-
// Return 204 No Content to indicate no SSE endpoint available
71-
// This forces pure request/response mode which avoids stream handling issues
72-
if (acceptHeader.includes('text/event-stream') && sessionId) {
73-
console.log('GET / with SSE request - returning 204 (SSE not supported)', sessionId)
74-
return new Response(null, {
75-
status: 204,
76-
headers: {
77-
'Access-Control-Allow-Origin': '*',
78-
'Mcp-Session-Id': sessionId,
79-
},
80-
})
81-
}
82-
83-
// Regular browser GET request - return marketing page
65+
// Always return marketing page for GET requests
66+
// SSE endpoint is not supported - clients should use POST for all requests
8467
return new Response(MARKETING_PAGE_HTML, {
8568
status: 200,
8669
headers: {
8770
'Content-Type': 'text/html',
8871
'Cache-Control': 'public, max-age=3600',
72+
'Access-Control-Allow-Origin': '*',
8973
},
9074
})
9175
} else {

0 commit comments

Comments
 (0)