mcp: fix upstream client access token (#5626)

## Summary

the `mcp: pass_upstream_access_token` option should take effect even if
no upstream oauth config is set.

## Related issues

<!-- For example...
- #159
-->

## User Explanation

<!-- How would you explain this change to the user? If this
change doesn't create any user-facing changes, you can leave
this blank. If filled out, add the `docs` label -->

## Checklist

- [ ] reference any related issues
- [ ] updated unit tests
- [ ] add appropriate label (`enhancement`, `bug`, `breaking`,
`dependencies`, `ci`)
- [ ] ready for review
This commit is contained in:
Denis Mishin 2025-05-28 13:20:02 -07:00 committed by GitHub
parent 180884cc21
commit 957e0982c1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -224,7 +224,7 @@ func (p *MCP) HasUpstreamOAuth2() bool {
// IsUpstreamClientNeedsAccessToken checks if the route is for the MCP Client and if it needs to pass the upstream access token // IsUpstreamClientNeedsAccessToken checks if the route is for the MCP Client and if it needs to pass the upstream access token
func (p *MCP) IsUpstreamClientNeedsAccessToken() bool { func (p *MCP) IsUpstreamClientNeedsAccessToken() bool {
return p != nil && p.UpstreamOAuth2 != nil && p.PassUpstreamAccessToken return p != nil && p.PassUpstreamAccessToken
} }
type UpstreamOAuth2 struct { type UpstreamOAuth2 struct {