Fix HttpClient timeout for long-running tools without event stream store#1268
Fix HttpClient timeout for long-running tools without event stream store#1268stephentoub merged 9 commits intomainfrom
Conversation
…tool calls Co-authored-by: halter73 <54385+halter73@users.noreply.github.com>
Co-authored-by: halter73 <54385+halter73@users.noreply.github.com>
Co-authored-by: halter73 <54385+halter73@users.noreply.github.com>
halter73
left a comment
There was a problem hiding this comment.
@copilot It looks like AuthorizationFlow_UsesScopeFromForbiddenHeader is now failing because it tries to change the status code in the tool call handler after we've already flushed the status and response headers leading to an InvalidOperationException. Please update this test to use middleware along with HttpReqest.EnableBuffering() to manually read the incoming JsonRpcMessages using McpJsonUtilities and then setting the 403 and short circuiting for the appropriate tool call.
src/ModelContextProtocol.Core/Server/StreamableHttpPostTransport.cs
Outdated
Show resolved
Hide resolved
tests/ModelContextProtocol.AspNetCore.Tests/MapMcpStreamableHttpTests.cs
Outdated
Show resolved
Hide resolved
Co-authored-by: halter73 <54385+halter73@users.noreply.github.com>
Co-authored-by: halter73 <54385+halter73@users.noreply.github.com>
Done in d8dce51. Updated both |
tests/ModelContextProtocol.AspNetCore.Tests/MapMcpStreamableHttpTests.cs
Outdated
Show resolved
Hide resolved
tests/ModelContextProtocol.AspNetCore.Tests/StreamableHttpServerConformanceTests.cs
Outdated
Show resolved
Hide resolved
…eter Co-authored-by: halter73 <54385+halter73@users.noreply.github.com>
Co-authored-by: halter73 <54385+halter73@users.noreply.github.com>
…yteArrayAsync Co-authored-by: halter73 <54385+halter73@users.noreply.github.com>
responseHeadersfor clarityReadAsByteArrayAsyncinstead of stream read to avoid CA2022All feedback addressed. All tests passing.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.