File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed
Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change 55} from "@modelcontextprotocol/sdk/types.js" ;
66import { ServerSentEventStream } from "@std/http" ;
77
8+ const SSE_STREAM_METHODS = [ "notifications/initialized" ] ;
89/**
910 * Server transport for Stateless HTTP: this will handle messages over plain HTTP requests
1011 * with optional SSE upgrade for streaming responses.
@@ -79,7 +80,8 @@ export class StatelessServerTransport implements Transport {
7980 private shouldUpgradeToStreaming ( message : JSONRPCMessage ) : boolean {
8081 // Implement logic to determine if streaming is needed
8182 // For example, based on method name or parameters
82- return message . method === "notifications/initialized" ; // Default to non-streaming
83+ return "method" in message && typeof message . method === "string" &&
84+ SSE_STREAM_METHODS . includes ( message . method ) ;
8385 }
8486
8587 start ( ) : Promise < void > {
You can’t perform that action at this time.
0 commit comments