Skip to content

Conversation

@sicoyle
Copy link

@sicoyle sicoyle commented Jan 23, 2026

This is a fix for an agent hang that I saw in Dapr Agents when it was trying to connect to the Github MCP server using streamable HTTP Transport. I only saw the issue if I ran it locally in terminal, but it was fine within the scope of a debugger. That led me down the path of a race condition. The MCP streamable_http client starts a background GET stream for SSE events that immediately get a 405 err from Github (which doesn't support GET), retries twice with the 1sec delay, and then gives up failing silently. If I called to list tools after the GET stream exhausted it's retries, it would hang forever waiting for the SSE responses on the dead stream. This PR prevents this hang by handling the 405 error.

Motivation and Context

I'm associated with the Dapr open source project (CNCF graduated project), and am a maintainer for Dapr Agents repo. We are experiencing issues that this PR helps to correct for our open source community.

dapr/dapr-agents#399

How Has This Been Tested?

I tested and confirmed this works against my repo for a release note agent that we want to eventually publicize and make into a github action that others can consume for open source project release notes when it's ready:
https://github.com/sicoyle/release-note-agent

I can confirm locally that this corrects at least my hanging issue.

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

related issues:
#1941
dapr/dapr-agents#399

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