Skip to content

feat(auth): support returning extra fields from token exchange#700

Open
glicht wants to merge 2 commits intomodelcontextprotocol:mainfrom
binahm:feat/auth-extra-token-fields
Open

feat(auth): support returning extra fields from token exchange#700
glicht wants to merge 2 commits intomodelcontextprotocol:mainfrom
binahm:feat/auth-extra-token-fields

Conversation

@glicht
Copy link
Contributor

@glicht glicht commented Feb 26, 2026

Added VendorExtraTokenFields to be used with StandardTokenResponse to expose any vendor-specific fields the authorization server may have included in the JSON response body for token generation.

exchange_code_for_token and refresh_token now return a StandardTokenResponse which includes any additional fields which might have been sent by the authorization server.

Motivation and Context

Some vendors return additional fields as part of the token API. I've experienced this specifically with HubSpot MCP Server which includes additional fields in it's response. It wasn't possible to access these fields when calling exchange_code_for_token.

How Has This Been Tested?

Tested locally with HubSpot's MCP server.

Breaking Changes

Return type of exchange_code_for_token and refresh_token has changed and may require code changes.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

Additional context

…token generation

exchange_code_for_token and refresh_token now return a StandardTokenResponse which includes
any additionalfields which might have been sent by the vendor

BREAKING CHANGE: Return type of exchange_code_for_token and refresh_token has changed
and may require code changes.
@glicht glicht requested a review from a team as a code owner February 26, 2026 20:36
@github-actions github-actions bot added T-core Core library changes T-transport Transport layer changes labels Feb 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

T-core Core library changes T-transport Transport layer changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant