Skip to content

fix: Explicitly declare accpet type to json when exchanging oauth token #801

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

JoJoJoJoJoJoJo
Copy link
Contributor

@JoJoJoJoJoJoJo JoJoJoJoJoJoJo commented Jul 23, 2025

When exchanging OAuth token, explicitly declare the accept type to JSON as it's potentially indicated

Motivation and Context

When using official github mcp server, the default response is not a valid json and causes json parse error. (Returned something like access_token=[some token]&scope=[some scope]&token_type=bearer). After adding the header the response is json. So the type may need to be explicitly declared if it will be treated as json format.

How Has This Been Tested?

Tested with github mcp server

Breaking Changes

No

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

@JoJoJoJoJoJoJo JoJoJoJoJoJoJo requested a review from a team as a code owner July 23, 2025 10:12
@JoJoJoJoJoJoJo JoJoJoJoJoJoJo requested a review from pcarleton July 23, 2025 10:12
@pcarleton pcarleton merged commit 62c608d into modelcontextprotocol:main Jul 24, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants