File tree 1 file changed +3
-1
lines changed
1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change 5
5
} from "@modelcontextprotocol/sdk/types.js" ;
6
6
import { ServerSentEventStream } from "@std/http" ;
7
7
8
+ const SSE_STREAM_METHODS = [ "notifications/initialized" ] ;
8
9
/**
9
10
* Server transport for Stateless HTTP: this will handle messages over plain HTTP requests
10
11
* with optional SSE upgrade for streaming responses.
@@ -79,7 +80,8 @@ export class StatelessServerTransport implements Transport {
79
80
private shouldUpgradeToStreaming ( message : JSONRPCMessage ) : boolean {
80
81
// Implement logic to determine if streaming is needed
81
82
// 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 ) ;
83
85
}
84
86
85
87
start ( ) : Promise < void > {
You can’t perform that action at this time.
0 commit comments