Skip to content

Commit cccc086

Browse files
jbafindleyr
authored andcommitted
mcp: clarify Server.Run use
Make it clear that it's not needed for an HTTP server.
1 parent 4e413da commit cccc086

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

mcp/server.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -513,6 +513,10 @@ func (s *Server) unsubscribe(ctx context.Context, ss *ServerSession, params *Uns
513513
// advertise the capability for tools, including the ability to send list-changed notifications.
514514
// If no tools have been added, the server will not have the tool capability.
515515
// The same goes for other features like prompts and resources.
516+
//
517+
// Run is a convenience for servers that handle a single session (or one session at a time).
518+
// It need not be called on servers that are used for multiple concurrent connections,
519+
// as with [StreamableHTTPHandler].
516520
func (s *Server) Run(ctx context.Context, t Transport) error {
517521
ss, err := s.Connect(ctx, t)
518522
if err != nil {

0 commit comments

Comments
 (0)