mcp: pass TokenInfo to server handler (#292)
If there is a TokenInfo in the request context of a StreamableServerTransport, then propagate it through to the ServerRequest that is passed to server methods like callTool. Fixes #317.
This commit is contained in:
parent
1a54234c27
commit
8e6ab130d8
1 changed files with 109 additions and 16 deletions
|
|
@ -68,6 +68,7 @@ func newServerTool[In, Out any](t *Tool, h ToolHandlerFor[In, Out]) (*serverTool
|
|||
res, err := h(ctx, &ServerRequest[*CallToolParamsFor[In]]{
|
||||
Session: req.Session,
|
||||
Params: params,
|
||||
Extra: req.Extra,
|
||||
})
|
||||
// TODO(rfindley): investigate why server errors are embedded in this strange way,
|
||||
// rather than returned as jsonrpc2 server errors.
|
||||
|
|
|
|||
Loading…
Reference in a new issue