Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Fix invalid initialize request handling - #1709

#1709
Open
lntutor wants to merge 1 commit into
modelcontextprotocol:mainmodelcontextprotocol/csharp-sdk:mainfrom
lntutor:fix/invalid-initialize-params-788lntutor/csharp-sdk:fix/invalid-initialize-params-788Copy head branch name to clipboard
Open

Fix invalid initialize request handling#1709
lntutor wants to merge 1 commit into
modelcontextprotocol:mainmodelcontextprotocol/csharp-sdk:mainfrom
lntutor:fix/invalid-initialize-params-788lntutor/csharp-sdk:fix/invalid-initialize-params-788Copy head branch name to clipboard

Conversation

@lntutor

@lntutor lntutor commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

Summary

  • validate initialize request parameters before creating an HTTP session
  • return HTTP 400 with JSON-RPC InvalidParams and the original request ID
  • cover a missing clientInfo.version payload

Testing

  • dotnet build
  • ASP.NET Core test suite on net8.0, net9.0, and net10.0

Fixes #788

Comment thread src/ModelContextProtocol.AspNetCore/StreamableHttpHandler.cs Outdated
@jeffhandley jeffhandley added this to the 2.x milestone Jul 27, 2026
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.

Passing a malformed body throws a 500 error instead of 400. Very hard to figure out what is incorrect in the request being issued by the caller

3 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.