Skip to content

Conversation

@Randgalt
Copy link
Contributor

@Randgalt Randgalt commented Oct 30, 2025

Support an HTTP GET handler for HttpServletStatelessServerTransport

Currently, HttpServletStatelessServerTransport always returns
SC_METHOD_NOT_ALLOWED for GET. With this change, consumers of the
library can implement their own GET handler so that they can implement
the Session semantics of the MCP protocol.

Note: GetHandler interfaces are specific to each McpStatelessServerTransport. This allows the greatest flexibility and should be easier to manage/maintain.

Note: I've rebased this on #641 so the first commit is duplicated here due to GitHub limitations.

Motivation and Context

Combined with #641 the library has enough primitives to implement support for MCP sessions. We would really like to add support for MCP sessions and, with these changes, can do it in our application code without any further changes to this library. Of course, if there's interest, we can contribute the changes back to this library.

How Has This Been Tested?

It's a very simple change - is a test needed?

Breaking Changes

None

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

This will allow setting custom MCP handlers that defer to the handler
that is set by the framework
@Randgalt Randgalt changed the title Jordanz/support get handler Support an HTTP GET handler for HttpServletStatelessServerTransport Oct 30, 2025
@Randgalt Randgalt force-pushed the jordanz/support-get-handler branch 3 times, most recently from 1e8799d to 2d789f8 Compare October 31, 2025 10:23
Currently, `HttpServletStatelessServerTransport` always returns
`SC_METHOD_NOT_ALLOWED` for GET. With this change, consumers of the
library can implement their own GET handler so that they can implement
the Session semantics of the MCP protocol.
@Randgalt Randgalt force-pushed the jordanz/support-get-handler branch from 2d789f8 to 1072617 Compare October 31, 2025 10:31
@Randgalt
Copy link
Contributor Author

We think we can do what we need without this change. Closing for now.

@Randgalt Randgalt closed this Oct 31, 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.

1 participant