Skip to content

Commit d9af8d7

Browse files
author
Yashwanth H L
committed
Add better documentation notes to WithHTTPServer and WithStreamableHTTPServer
1 parent e682995 commit d9af8d7

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

server/sse.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,9 @@ func WithSSEEndpoint(endpoint string) SSEOption {
227227
}
228228
}
229229

230-
// WithHTTPServer sets the HTTP server instance
230+
// WithHTTPServer sets the HTTP server instance.
231+
// NOTE: When providing a custom HTTP server, you must handle routing yourself
232+
// If routing is not set up, the server will start but won't handle any MCP requests.
231233
func WithHTTPServer(srv *http.Server) SSEOption {
232234
return func(s *SSEServer) {
233235
s.srv = srv

server/streamable_http.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,9 @@ func WithHTTPContextFunc(fn HTTPContextFunc) StreamableHTTPOption {
7373
}
7474
}
7575

76-
// WithStreamableHTTPServer sets the HTTP server instance for StreamableHTTPServer
76+
// WithStreamableHTTPServer sets the HTTP server instance for StreamableHTTPServer.
77+
// NOTE: When providing a custom HTTP server, you must handle routing yourself
78+
// If routing is not set up, the server will start but won't handle any MCP requests.
7779
func WithStreamableHTTPServer(srv *http.Server) StreamableHTTPOption {
7880
return func(s *StreamableHTTPServer) {
7981
s.httpServer = srv

0 commit comments

Comments
 (0)