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

Function clientSessionMethod

mcp/shared.go:339–343  ·  view source on GitHub ↗

clientSessionMethod is glue for creating a typedMethodHandler from a method on ServerSession.

(f func(*ClientSession, context.Context, P) (R, error))

Source from the content-addressed store, hash-verified

337
338// clientSessionMethod is glue for creating a typedMethodHandler from a method on ServerSession.
339func clientSessionMethod[P Params, R Result](f func(*ClientSession, context.Context, P) (R, error)) typedClientMethodHandler[P, R] {
340 return func(ctx context.Context, req *ClientRequest[P]) (R, error) {
341 return f(req.GetSession().(*ClientSession), ctx, req.Params)
342 }
343}
344
345// MCP-specific error codes.
346const (

Callers 1

client.goFile · 0.85

Calls 1

GetSessionMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…