Skip to content

Clearing tokens properly #96

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 6, 2025
Merged

Clearing tokens properly #96

merged 1 commit into from
Jun 6, 2025

Conversation

geelen
Copy link
Owner

@geelen geelen commented May 27, 2025

This builds upon the changes in modelcontextprotocol/typescript-sdk#570

Now, when a MCP server returns a invalid_client or invalid_grant response, the corresponding local credentials are wiped and things retry. I have tested https://pkg.pr.new/mcp-remote@96 and can confirm that several of the failure cases are no longer dead ends. It now just detects the stale data, clears it, and retries.

This should mean that rm -rf ~/.mcp-auth is needed a lot less often, and in fact, should allow us to preserve auth between mcp-remote releases (currently every new version saves auth into a new blank subdirectory).

This PR is in draft while the upstream PR is in flight, but as soon as that's merged this can be released.

Copy link

pkg-pr-new bot commented May 27, 2025

Open in StackBlitz

npx https://pkg.pr.new/mcp-remote@96

commit: b366dec

@geelen geelen force-pushed the clear-tokens branch 2 times, most recently from 2246c51 to 14592ca Compare May 30, 2025 03:59
@geelen geelen changed the title [WIP] Clearing tokens properly Clearing tokens properly May 30, 2025
@geelen geelen marked this pull request as ready for review June 4, 2025 05:46
@geelen geelen merged commit 36ed05e into main Jun 6, 2025
4 checks passed
@geelen
Copy link
Owner Author

geelen commented Jun 6, 2025

Released as v0.1.14

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.

1 participant