Skip to content

fix(mcp): log OAuth refresh failure diagnostics on auth-loss - #1969

Merged
Aaronontheweb merged 3 commits into
netclaw-dev:devfrom
nixie-ai:fix/mcp-oauth-refresh-logging
Aug 17, 2026
Merged

Aaronontheweb merged 3 commits into
netclaw-dev:devfrom
nixie-ai:fix/mcp-oauth-refresh-logging

Conversation

@nixie-ai

@nixie-ai nixie-ai commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

Problem

When a stored OAuth record can no longer produce a working access token, SDK 2.0's refresh path fails silently. Refresh is only attempted when the cached token container matches the live provider on all four binding fields — AuthorizationServer, ClientId, ClientSecret, TokenEndpointAuthMethod — and even then the raw refresh HTTP response is swallowed (returned null, surfaced as the generic null authorization result). The opaque failure made the recurring Atlassian MCP nightly Jira PR review failures undiagnosable.

Change

Report exactly which binding field is missing/mismatched, whether a refresh token existed to redeem, access-token expiry, and dynamic-registration state whenever an auth failure demotes a server to AwaitingAuth or AuthFailed (catalog refresh + connection paths).

Companion root-cause PR: #1970 (persist SDK-resolved client identity).

When a stored OAuth record can no longer produce a working access token,
SDK 2.0's refresh path fails silently: a refresh is only attempted when the
cached token container matches the live provider on all four binding fields
(AuthorizationServer, ClientId, ClientSecret, TokenEndpointAuthMethod),
and even then the raw refresh HTTP response is swallowed (returned null,
surfaced as the generic 'null authorization result'). The opaque failure
made nightly Jira PR reviews undiagnosable.

Report exactly which binding field is missing/mismatched, whether a refresh
token existed to redeem, access-token expiry, and dynamic-registration state
whenever an auth failure demotes a server to AwaitingAuth or AuthFailed.

@Aaronontheweb Aaronontheweb left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Aaronontheweb
Aaronontheweb enabled auto-merge (squash) August 17, 2026 21:14
@Aaronontheweb Aaronontheweb added the mcp Model context protocol server / client issues. label Aug 17, 2026
@Aaronontheweb
Aaronontheweb merged commit fb19268 into netclaw-dev:dev Aug 17, 2026
17 checks passed
@Aaronontheweb Aaronontheweb mentioned this pull request Aug 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mcp Model context protocol server / client issues. observability

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants