From f4dde63cad4cc7f3ed161e129635362cd32070bf Mon Sep 17 00:00:00 2001 From: Jonathan Amsterdam Date: Sat, 9 Aug 2025 10:43:15 -0400 Subject: [PATCH] mcp: clarify Server.Run use Make it clear that it's not needed for an HTTP server. --- mcp/server.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mcp/server.go b/mcp/server.go index e69a872e..d81dec60 100644 --- a/mcp/server.go +++ b/mcp/server.go @@ -513,6 +513,10 @@ func (s *Server) unsubscribe(ctx context.Context, ss *ServerSession, params *Uns // advertise the capability for tools, including the ability to send list-changed notifications. // If no tools have been added, the server will not have the tool capability. // The same goes for other features like prompts and resources. +// +// Run is a convenience for servers that handle a single session (or one session at a time). +// It need not be called on servers that are used for multiple concurrent connections, +// as with [StreamableHTTPHandler]. func (s *Server) Run(ctx context.Context, t Transport) error { ss, err := s.Connect(ctx, t) if err != nil {