Skip to content

Conversation

@hashemix
Copy link
Member

📌 Summary

This PR introduces support for OAuth 2.0 / OpenID Connect authentication in the rust-mcp-sdk using the new RemoteAuthProvider. It enables integration with external identity providers that support Dynamic Client Registration (DCR), such as Keycloak, WorkOS AuthKit, and ScaleKit. The update includes token verification, metadata discovery, and a new example demonstrating remote OAuth with Keycloak.

Additionally, it includes minor fixes and documentation improvements.

✨ Changes Made

  • Added RemoteAuthProvider for remote identity providers with DCR support.
  • Implemented a generic token verification supporting JWKs , introspection and userinfo strategies (via rust-mcp-extra).
  • Support for protected resources, scopes (e.g., mcp:tools), and CORS handling via middleware.
  • Added auth-related tests (e.g., metadata endpoint, OPTIONS preflight, tool calls with auth info).
  • New Example: examples/auth/server-oauth-remote , A complete MCP server example using Keycloak for remote OAuth, including setup instructions in README.md.

🛠️ Testing Steps

cargo make check

@hashemix hashemix changed the title feat: implement authentication flow for the MCP server feat: implement authentication flow for the MCP servers Nov 23, 2025
@hashemix hashemix changed the title feat: implement authentication flow for the MCP servers feat: add authentication flow support to MCP servers Nov 23, 2025
@hashemix hashemix merged commit fe467d3 into main Nov 23, 2025
3 checks passed
@hashemix hashemix mentioned this pull request Nov 23, 2025
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.

2 participants