Skip to content

Add Middleware handlers to StreamableHttpTransport#218

Open
sveneld wants to merge 1 commit intomodelcontextprotocol:mainfrom
sveneld:middleware
Open

Add Middleware handlers to StreamableHttpTransport#218
sveneld wants to merge 1 commit intomodelcontextprotocol:mainfrom
sveneld:middleware

Conversation

@sveneld
Copy link

@sveneld sveneld commented Dec 31, 2025

Motivation and Context

This pull request gives a possibility to add different middlewares to StreamableHttpTransport for different approach.

How Has This Been Tested?

Unit tests

Breaking Changes

No

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

@sveneld
Copy link
Author

sveneld commented Jan 6, 2026

@chr-hertel please take a look

@chr-hertel
Copy link
Member

chr-hertel commented Jan 6, 2026

On the first glance, i feel like it makes it more sophisticated, is it needed tho?
The idea would be that frameworks could register their own middleware and solve auth on their own? or would you rework #194 to use that middleware than? or both eventually i guess?

maybe i'm missing the point here ...

@sveneld
Copy link
Author

sveneld commented Jan 8, 2026

Yep, that’s the idea. #194 will be rewritten on top of this middleware approach, and it also opens the door for community/custom middlewares without patching core.

@sveneld
Copy link
Author

sveneld commented Jan 12, 2026

@chr-hertel #221 is a pull request with oAuth implementation based on middleware. I created a new pull request instead of update previous

@chr-hertel chr-hertel added the auth Issues and PRs related to Authentication / OAuth label Jan 23, 2026
@sveneld
Copy link
Author

sveneld commented Feb 4, 2026

@chr-hertel maybe we should go step by step and this pull request will be first part for oauth implementing?

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants