-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Description
Describe the bug
The ProxyOAuthServerProvider's client registration fails with a Zod schema validation error when using Hydra as the upstream OAuth provider. The error occurs because Hydra returns "contacts": null in the client registration response, but the MCP SDK's OAuthClientInformationFullSchema expects contacts to be an array.
To Reproduce
Steps to reproduce the behavior:
- Configure ProxyOAuthServerProvider with Hydra endpoints (e.g., registrationUrl pointing to Hydra's
/oauth2/register
) - Attempt client registration through the MCP server
- Registration request succeeds at Hydra but fails during MCP SDK's response parsing
Expected behavior
Client registration should succeed when using standards-compliant OAuth2 providers like Hydra that return valid OAuth client information responses.
Logs
Unexpected error registering client: ZodError: [
{
"code": "invalid_type",
"expected": "array",
"received": "null",
"path": [
"contacts"
],
"message": "Expected array, received null"
}
]
at Object.registerClient
(/node_modules/@modelcontextprotocol/sdk/src/server/auth/providers/proxyProvider.ts:113:51)
Additional context
Hydra returns valid RFC 7591 compliant client registration responses where optional fields like contacts can be null. The MCP SDK's Zod schema appears to be stricter than the OAuth2 specification requires for these optional fields.