Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions mcp/logging.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ func NewLoggingHandler(ss *ServerSession, opts *LoggingHandlerOptions) *LoggingH

// Enabled implements [slog.Handler.Enabled] by comparing level to the [ServerSession]'s level.
func (h *LoggingHandler) Enabled(ctx context.Context, level slog.Level) bool {
// This is also checked in ServerSession.LoggingMessage, so checking it here
// This is also checked in ServerSession.Log, so checking it here
// is just an optimization that skips building the JSON.
if mcpLevel, ok := logLevelFromContext(ctx); ok {
return mcpLevel != "" && level >= mcpLevelToSlog(mcpLevel)
Expand All @@ -177,7 +177,7 @@ func (h *LoggingHandler) WithGroup(name string) slog.Handler {
}

// Handle implements [slog.Handler.Handle] by writing the Record to a JSONHandler,
// then calling [ServerSession.LoggingMessage] with the result.
// then calling [ServerSession.Log] with the result.
func (h *LoggingHandler) Handle(ctx context.Context, r slog.Record) error {
err := h.handle(ctx, r)
// TODO(jba): find a way to surface the error.
Expand Down
4 changes: 2 additions & 2 deletions mcp/protocol.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func annotateResultType(res Result) {

// InputRequest is a type for parameters that a server can include in the response
// to request input from client (SEP-2322). Implementations are [*ElicitParams],
// [*CreateMessageParams], and [*ListRootsParams].
// [*CreateMessageParams], [*CreateMessageWithToolsParams], and [*ListRootsParams].
type InputRequest interface{ isInputRequest() }

// InputRequestMap maps server-assigned request IDs to [InputRequest] values.
Expand Down Expand Up @@ -143,7 +143,7 @@ func (m *InputRequestMap) UnmarshalJSON(data []byte) error {

// InputResponse is a type for results that a client sends back when fulfilling
// a server input request (SEP-2322). Implementations are [*ElicitResult],
// [*CreateMessageResult], and [*ListRootsResult].
// [*CreateMessageResult], [*CreateMessageWithToolsResult], and [*ListRootsResult].
type InputResponse interface{ isInputResponse() }

// InputResponseMap maps request IDs (from [InputRequestMap]) to [InputResponse]
Expand Down
6 changes: 3 additions & 3 deletions mcp/streamable.go
Original file line number Diff line number Diff line change
Expand Up @@ -2808,9 +2808,9 @@ func (c *streamableClientConn) checkResponse(ctx context.Context, requestSummary
}

// processStream reads from a single response body, sending events to the
// incoming channel. It returns the ID of the last processed event and a flag
// indicating if the connection was closed by the client. If resp is nil, it
// returns "", false.
// incoming channel. It returns the ID of the last processed event, the
// reconnect delay requested by the server (if any), and a flag indicating
// whether the connection was closed by the client. resp must be non-nil.
func (c *streamableClientConn) processStream(ctx context.Context, requestSummary string, resp *http.Response, forCall *jsonrpc.Request) (lastEventID string, reconnectDelay time.Duration, clientClosed bool) {
defer func() {
// Drain any remaining unprocessed body. This allows the connection to be re-used after closing.
Expand Down
Loading