-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
During the OAuth token exchange, some providers (e.g. NetSuite) do not respond following the RFC 6749 specs, and return the expires_in field as a numeric string.
It would be helpful to support such uses cases; to solve the issue, I simply applied this patch to https://github.com/modelcontextprotocol/typescript-sdk/blob/main/src/shared/auth.ts (line 139):
expires_in: z.coerce.number().optional(),
To Reproduce
Steps to reproduce the behavior:
- Setup an integration record in NetSuite
- Create a client and start the OAuth process
- See the authentication succeeding
- After the code is received, see the token request-response failing with the following message:
Error: Invalid token response from OAuth provider
Expected 'expires_in' to be a number, received string
Expected behavior
Token expiration is parsed as a numeric string.
Logs
See the above error message.
Additional context
Tested against NetSuite 2025.2.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working