Skip to content

Conversation

@nbarbettini
Copy link
Contributor

Motivation and Context

Fixes an error noticed by @cliffhall in this PR: #1105 (comment)

How Has This Been Tested?

Working as expected once again:
image

Breaking Changes

n/a

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

Problem: To create src/examples/client/elicitationUrlExample.ts I copied some code from src/examples/client/simpleOAuthClient.ts, but I copied older code that was later cleaned up and refactored.

Solution: Adopting the better connect() pattern from simpleOAuthClient.ts made the problem go away.

The real root cause was:

            requestInit: {
                headers: {
                    'Content-Type': 'application/json',
                    Accept: 'application/json, text/event-stream'
                }
            }

which clashed with 'Content-Type': 'application/x-www-form-urlencoded' set in exchangeAuthorization() in src/client/auth.ts. I believe it might be useful to normalize header case-sensitivity in createFetchWithInit(), but that is deeper than I want to go in this PR! 🙂

@nbarbettini nbarbettini requested a review from a team as a code owner November 18, 2025 23:22
@nbarbettini nbarbettini mentioned this pull request Nov 18, 2025
9 tasks
@pkg-pr-new
Copy link

pkg-pr-new bot commented Nov 18, 2025

Open in StackBlitz

npm i https://pkg.pr.new/modelcontextprotocol/typescript-sdk/@modelcontextprotocol/sdk@1136

commit: 044f109

@KKonstantinov
Copy link
Contributor

Thanks for the quick follow up

@felixweinberger felixweinberger removed the request for review from cliffhall November 20, 2025 13:12
@felixweinberger
Copy link
Contributor

Hi @nbarbettini thanks for the quick fix!

Was just going to merge this, but looks like maintainerCanModify is false on this branch so I can't update branch to merge in main - mind doing that today so we can get this into the release?

@felixweinberger felixweinberger enabled auto-merge (squash) November 20, 2025 15:01
@felixweinberger felixweinberger merged commit fc4a6ec into modelcontextprotocol:main Nov 20, 2025
6 checks passed
@nbarbettini
Copy link
Contributor Author

Fixed! Thanks @felixweinberger

@nbarbettini nbarbettini deleted the fix-elicitation-example branch November 20, 2025 18:34
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.

3 participants