-
Notifications
You must be signed in to change notification settings - Fork 285
mcp: pass TokenInfo to server handler #292
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
94d7a12 to
015a473
Compare
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.
015a473 to
58d9bbe
Compare
|
Sorry about the force push! I rebased onto main. |
|
@jba just wanted to check/confirm that you are not limiting to specific http headers and also support any custom headers to be propagated to tool implementation |
|
We can do that, but can you give an example of how you'd use it? |
findleyr
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, but I know nothing about oauth. Add dneil for that, either in this CL or as an audit pass?
|
The only OAuth-relevant part of this PR, AFAICT, is RequiredBearerTokenOptions.Scopes. That comes right from type typescript: I guess we could bikeshed the name ("RequiredScopes"?) but otherwise there's nothing to see here. |
We have usecase where we need to propagate the incoming header to backend APIs invoked by tool implementation |
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 modelcontextprotocol#317.
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.