Title: fix: reject changed duplicate initialize by he-yufeng · Pull Request #2606 · modelcontextprotocol/python-sdk · GitHub
Open Graph Title: fix: reject changed duplicate initialize by he-yufeng · Pull Request #2606 · modelcontextprotocol/python-sdk
X Title: fix: reject changed duplicate initialize by he-yufeng · Pull Request #2606 · modelcontextprotocol/python-sdk
Description: Summary reject a second initialize request if it tries to change the session's client parameters keep the first client_params intact so later capability checks cannot be spoofed by a duplicate handshake add a regression test covering the changed-params path To verify uv run pytest tests/server/test_session.py -q -k "duplicate_initialize or server_session_initialize" uv run ruff check src/mcp/server/session.py tests/server/test_session.py uv run pyright src/mcp/server/session.py tests/server/test_session.py uv run python -m py_compile src/mcp/server/session.py tests/server/test_session.py git diff --check Closes #2605
Open Graph Description: Summary reject a second initialize request if it tries to change the session's client parameters keep the first client_params intact so later capability checks cannot be spoofed by a duplicate...
X Description: Summary reject a second initialize request if it tries to change the session's client parameters keep the first client_params intact so later capability checks cannot be spoofed by a dupli...
Opengraph URL: https://github.com/modelcontextprotocol/python-sdk/pull/2606
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:e26c4fae-7333-ac46-5f42-db3a52d15b47 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | CDBA:22B385:82102A:AFEEEF:6A5A821F |
| html-safe-nonce | 0977b10af8730c411407a8a151f80453953a8356bb1f38d16992cbafff94d1be |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDREJBOjIyQjM4NTo4MjEwMkE6QUZFRUVGOjZBNUE4MjFGIiwidmlzaXRvcl9pZCI6IjIwMjYyODc0ODUyMzY3MDc4NzIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 73a77bdda17caf328fdfbd0d62c36166bc65bc831fb9e2d0c33c2e458c076758 |
| hovercard-subject-tag | pull_request:3690055077 |
| 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/2606/files |
| twitter:image | https://avatars.githubusercontent.com/u/40085740?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/40085740?s=400&v=4 |
| og:image:alt | Summary reject a second initialize request if it tries to change the session's client parameters keep the first client_params intact so later capability checks cannot be spoofed by a duplicate... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 922bdba685ea48400234d557977f0e32d9adbae6f5125725b4f48cacc6801106 |
| 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 | 7c8a44665d760d73ead7e85d8f88b299152aa681 |
| ui-target | canary-2 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width