Skip to content

fix: do not raise errors. Let mcp sdk handle the http errors#66

Merged
wzxxing merged 1 commit into
mainfrom
wzxxing/fix-http-errors
Nov 5, 2025
Merged

fix: do not raise errors. Let mcp sdk handle the http errors#66
wzxxing merged 1 commit into
mainfrom
wzxxing/fix-http-errors

Conversation

@wzxxing

@wzxxing wzxxing commented Oct 31, 2025

Copy link
Copy Markdown
Contributor

Summary

Changes

Please provide a summary of what's being changed

As a MCP proxy, we should not handle the HTTP transport error for the MCP SDK. Remove the raise_for_status call,

User experience

Please share what the user experience looks like before and after this change

No user experience should change after this change because the python mcp sdk already handles the errors by themselves.

> rg raise_for_status src/

src/mcp/client/streamable_http.py
211:                event_source.response.raise_for_status()
240:            event_source.response.raise_for_status()
278:            response.raise_for_status()

src/mcp/client/sse.py
66:                    event_source.response.raise_for_status()
131:                                    response.raise_for_status()

src/mcp/server/fastmcp/resources/types.py
160:            response.raise_for_status()

Fix bug for deleting session because the mcp sdk calls raise_for_status after some checking status code 404.

If we raise the error in the httpx event hooks, the error would make deleting session fail.

Checklist

If your change doesn't seem to apply, please leave them unchecked.

  • I have reviewed the contributing guidelines
  • I have performed a self-review of this change
  • Changes have been tested
  • Changes are documented

Is this a breaking change? (Y/N)

  • Yes
  • No

Please add details about how this change was tested.

  • Did integration tests succeed?
  • If the feature is a new use case, is it necessary to add a new integration test case?

Acknowledgment

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@wzxxing wzxxing requested a review from a team as a code owner October 31, 2025 11:31
@wzxxing wzxxing requested review from anasstahr and harv-aws October 31, 2025 11:31
@wzxxing wzxxing enabled auto-merge (squash) October 31, 2025 11:33
@wzxxing wzxxing force-pushed the wzxxing/fix-http-errors branch from 55853ef to 0905e9a Compare October 31, 2025 11:34
@wzxxing wzxxing disabled auto-merge November 3, 2025 09:32
@wzxxing wzxxing force-pushed the wzxxing/fix-http-errors branch from a3cef91 to 01a4c70 Compare November 3, 2025 16:16
@wzxxing wzxxing merged commit a800c01 into main Nov 5, 2025
9 checks passed
@wzxxing wzxxing deleted the wzxxing/fix-http-errors branch November 5, 2025 09:26
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.

3 participants