-
Notifications
You must be signed in to change notification settings - Fork 334
vault set rejects clientInfo from OAuth dynamic client registration #286
Copy link
Copy link
Closed
Labels
P1Urgent regression or broken agent/channel workflow affecting real users now.Urgent regression or broken agent/channel workflow affecting real users now.clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.ClawSweeper found an open linked pull request for this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:auth-providerThis issue is about auth, provider routing, model choice, or SecretRef resolution.This issue is about auth, provider routing, model choice, or SecretRef resolution.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.
Description
Metadata
Metadata
Assignees
Labels
P1Urgent regression or broken agent/channel workflow affecting real users now.Urgent regression or broken agent/channel workflow affecting real users now.clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.ClawSweeper found an open linked pull request for this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:auth-providerThis issue is about auth, provider routing, model choice, or SecretRef resolution.This issue is about auth, provider routing, model choice, or SecretRef resolution.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.
Type
Fields
Priority
None yet
What happens
mcporter vault set <server> --stdinrejects client info that came from OAuth dynamic client registration. It prints:redirect_urisis an array, not a string. RFC 7591 registration responses always return it as an array. So any real DCR result is rejected and nothing is saved.This worked in 0.12.0. It broke in 0.12.1 and is still broken in 0.13.0.
Steps to reproduce
Create
~/.mcporter/mcporter.json:{"mcpServers":{"demo":{"url":"https://example.test/mcp","auth":"oauth"}}}Pipe a payload to
vault set:The access token is fake, so no real credential is involved. The server URL is never contacted.
What you get
On 0.12.1 and later, it exits with code 1 and prints:
On 0.12.0, the same command succeeds:
If you run the 0.12.0 case, remove the test entry afterwards with
mcporter vault clear demo.What I expected
The payload is saved.
redirect_urisis a normal part of client info.Where it comes from
In
dist/cli/vault-command.js:This requires every value to be a string. But
dist/oauth-client-info.d.tstypes client info asOAuthClientInformationMixedfrom the MCP SDK, and in@modelcontextprotocol/sdk/shared/auththat is:Neither member of that union can pass the check:
OAuthClientInformationhasclient_id_issued_atandclient_secret_expires_at, both numbers.OAuthClientInformationFulladdsredirect_uris,grant_typesandresponse_types, all arrays of strings.So the only client info the command accepts is
client_idplus optional string fields. Any registration response that carries issuance timestamps or metadata is refused, even though the declared type allows it.--tokens-filehas the same problem. Both sources go throughvalidateVaultPayload, so there is no way around it.Versions
Node 24, macOS. Nothing here looks platform specific.
Suggested fix
Check each field for its own type instead of requiring strings everywhere:
redirect_uris,grant_types,response_types— array of stringsclient_id_issued_at,client_secret_expires_at— numberclient_id,client_secret,client_name,token_endpoint_auth_method— stringDropping the
clientInfocheck and keeping thetokenschecks would also fix it.Related
#244 is also about
clientInfoon vault entries, but the other way around: it goes missing after authorization. These may be worth looking at together.Workaround
For anyone blocked on this: the write goes through if you trim
clientInfoto the string-only subset the validator accepts before piping it tovault set.With
jq:Applied to the payload from the report, that leaves
{"client_id":"abc","token_endpoint_auth_method":"none"}and the command succeeds on 0.12.1+.The same trim in TypeScript, if you are shelling out to
vault setfrom code:What it costs
Dropping
redirect_uris,grant_types,response_types,client_id_issued_atandclient_secret_expires_atis only safe when the caller owns registration:refresh_tokengrant sends no redirect URI, and the MCP SDK readsclient_idandtoken_endpoint_auth_methodwhen it authenticates the refresh call — so those two are the ones worth keeping.This is a workaround, not a fix. The validator still contradicts the
OAuthClientInformationMixedtype the command declares it accepts, and a schema-aware validator would let the full registration response through.