Title: Add MCP proxy helper by Kludex · Pull Request #2388 · modelcontextprotocol/python-sdk · GitHub
Open Graph Title: Add MCP proxy helper by Kludex · Pull Request #2388 · modelcontextprotocol/python-sdk
X Title: Add MCP proxy helper by Kludex · Pull Request #2388 · modelcontextprotocol/python-sdk
Description: Summary add a top-level mcp_proxy() helper in mcp/proxy.py and export it from mcp implement the proxy with the repo's generic read/write stream protocols and the reviewed on_error API replace the original timing- and coverage-driven test approach with deterministic tests for forwarding, error handling, and stream closure behavior Why PR #1763 was closed after accumulating review feedback. This reimplements the proxy from current main while applying the requested changes: move the module to mcp/proxy.py avoid new pragma: no cover additions remove timing-based sleeps from tests remove type: ignore assertions in tests simplify logging and broad exception handling Testing uv run pytest tests/test_proxy.py -q UV_CACHE_DIR=/tmp/uv-cache uv run ruff check src/mcp/proxy.py tests/test_proxy.py UV_CACHE_DIR=/tmp/uv-cache uv run pyright src/mcp/proxy.py tests/test_proxy.py
Open Graph Description: Summary add a top-level mcp_proxy() helper in mcp/proxy.py and export it from mcp implement the proxy with the repo's generic read/write stream protocols and the reviewed on_error API replace ...
X Description: Summary add a top-level mcp_proxy() helper in mcp/proxy.py and export it from mcp implement the proxy with the repo's generic read/write stream protocols and the reviewed on_error API repl...
Opengraph URL: https://github.com/modelcontextprotocol/python-sdk/pull/2388
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:cb24e71b-6acc-f6d6-abf3-f4d648bdbe2f |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | D24A:3A4C6B:24F276E:3307EAD:6A631C76 |
| html-safe-nonce | 1557103f42c00f949a71d82af822062b3ebc8083ed8b3cd9eb834a72a4927df0 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMjRBOjNBNEM2QjoyNEYyNzZFOjMzMDdFQUQ6NkE2MzFDNzYiLCJ2aXNpdG9yX2lkIjoiNjUwNTExODQwNTU3ODkyMzEyNiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | fa7ecaa38a98c55a89676644795c6a01c6f88ec364c5bc56a15235a170f54566 |
| hovercard-subject-tag | pull_request:3486253268 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/modelcontextprotocol/python-sdk/pull/2388/files |
| twitter:image | https://avatars.githubusercontent.com/u/7353520?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/7353520?s=400&v=4 |
| og:image:alt | Summary add a top-level mcp_proxy() helper in mcp/proxy.py and export it from mcp implement the proxy with the repo's generic read/write stream protocols and the reviewed on_error API replace ... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 1a6c056e02f174fffc096c521ec0ff6fb83e40a2ec8cb8875466ec1524872dd6 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/modelcontextprotocol/python-sdk git https://github.com/modelcontextprotocol/python-sdk.git |
| octolytics-dimension-user_id | 182288589 |
| octolytics-dimension-user_login | modelcontextprotocol |
| octolytics-dimension-repository_id | 862584018 |
| octolytics-dimension-repository_nwo | modelcontextprotocol/python-sdk |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 862584018 |
| octolytics-dimension-repository_network_root_nwo | modelcontextprotocol/python-sdk |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 6a93e25585f487ddff9e3996c06d5b869d6e1828 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width