Skip to content

[Server] Oauth2 based on middleware#221

Open
sveneld wants to merge 20 commits intomodelcontextprotocol:mainfrom
sveneld:oauth_middleware
Open

[Server] Oauth2 based on middleware#221
sveneld wants to merge 20 commits intomodelcontextprotocol:mainfrom
sveneld:oauth_middleware

Conversation

@sveneld
Copy link
Contributor

@sveneld sveneld commented Jan 12, 2026

Motivation and Context

Implementation of OAuth based on middlewares from #218

How Has This Been Tested?

Breaking Changes

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

Additional context

Fix #214

@chr-hertel
Copy link
Member

Thanks @sveneld - it will take some time for me to give some proper feedback here, just to let you know - needs quite some focus & attention - still really appreciated!

@chr-hertel chr-hertel changed the title Oauth2 based on middleware [Server] Oauth2 based on middleware Jan 23, 2026
@chr-hertel chr-hertel added Server Issues & PRs related to the Server component auth Issues and PRs related to Authentication / OAuth labels Jan 23, 2026
Copy link
Member

@chr-hertel chr-hertel left a comment

Choose a reason for hiding this comment

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

Hi again @sveneld! This is great already - went to a first round of very detailed review directly. Thanks again for working on this! 🙏

Didn't manage to go through all, but dropping the first round of comments.

@sveneld
Copy link
Contributor Author

sveneld commented Jan 28, 2026

@chr-hertel I updated pull request

@chr-hertel chr-hertel mentioned this pull request Feb 8, 2026
6 tasks
@Nyholm
Copy link
Contributor

Nyholm commented Feb 11, 2026

Can you please rebase this now when the Middleware Handler is merged?

Signed-off-by: Volodymyr Panivko <sveneld300@gmail.com>
@sveneld
Copy link
Contributor Author

sveneld commented Feb 11, 2026

Can you please rebase this now when the Middleware Handler is merged?

Done.

Copy link
Contributor

@Nyholm Nyholm left a comment

Choose a reason for hiding this comment

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

Great. Looks good.

I only have small things to comment at. I have not tested it out.

@sveneld
Copy link
Contributor Author

sveneld commented Feb 16, 2026

I have updated the pull request, but I am not satisfied with the result. I need more time to rethink the flow and improve the implementation.

@chr-hertel
Copy link
Member

@sveneld anything in particular you would need feedback here?
can tell you about nit picks already, e.g. using Mcp\Exception\*Exception classes instead of built-in ones

@sveneld
Copy link
Contributor Author

sveneld commented Feb 18, 2026

Thank you, no feedback needed.

@sveneld
Copy link
Contributor Author

sveneld commented Feb 22, 2026

@chr-hertel take a look.

…nversion

Signed-off-by: Volodymyr Panivko <sveneld300@gmail.com>
@chr-hertel
Copy link
Member

@chr-hertel take a look.

@sveneld will do so this weekend - thanks! 👍

Copy link
Member

@chr-hertel chr-hertel left a comment

Choose a reason for hiding this comment

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

Hi @sveneld, getting into polishing here I feel - thanks again for your work! Pretty sure i missed some parts, but you get the overall vibe of my review i guess.

Could you as well add some docs, especially what users would need to enable this feature? or could be a follow up PR if you like

@chr-hertel chr-hertel added the needs more work Not ready to be merged yet, needs additional follow-up from the author(s). label Mar 1, 2026
Volodymyr Panivko and others added 4 commits March 2, 2026 10:00
…into oauth_middleware

# Conflicts:
#	composer.json
#	examples/server/oauth-keycloak/Dockerfile
#	examples/server/oauth-keycloak/McpElements.php
#	examples/server/oauth-keycloak/README.md
#	examples/server/oauth-keycloak/docker-compose.yml
#	examples/server/oauth-keycloak/server.php
#	examples/server/oauth-microsoft/Dockerfile
#	examples/server/oauth-microsoft/McpElements.php
#	examples/server/oauth-microsoft/README.md
#	examples/server/oauth-microsoft/docker-compose.yml
#	examples/server/oauth-microsoft/server.php
#	src/Server/Transport/StreamableHttpTransport.php
@sveneld
Copy link
Contributor Author

sveneld commented Mar 2, 2026

@chr-hertel I’ve updated the pull request. If everything looks good, I’ll rebase and squash the commits.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auth Issues and PRs related to Authentication / OAuth needs more work Not ready to be merged yet, needs additional follow-up from the author(s). Server Issues & PRs related to the Server component

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Server] Implement OAuth Flow for Client Authentication

3 participants