MCPcopy Create free account
hub / github.com/modelcontextprotocol/go-sdk / Handle

Method Handle

internal/jsonrpc2/jsonrpc2.go:53–53  ·  view source on GitHub ↗

Handle is invoked sequentially for each incoming request that has not already been handled by a Preempter. If the Request has a nil ID, Handle must return a nil result, and any error may be logged but will not be reported to the caller. If the Request has a non-nil ID, Handle must return either a

(ctx context.Context, req *Request)

Source from the content-addressed store, hash-verified

51 // (If Handle returns ErrAsyncResponse, ctx will remain uncanceled
52 // until either Cancel or Respond is called for the request's ID.)
53 Handle(ctx context.Context, req *Request) (result any, err error)
54}
55
56// A HandlerFunc implements the Handler interface for a standalone Handle function.

Callers 10

installHandlersMethod · 0.65
TestAuthorizeFunction · 0.65
handleAsyncMethod · 0.65
handleMethod · 0.65
mainFunction · 0.65
mainFunction · 0.65
mainFunction · 0.65

Implementers 1

LoggingHandlermcp/logging.go

Calls

no outgoing calls