Title: Return METHOD_NOT_FOUND for invalid request methods by raashish1601 · Pull Request #2372 · modelcontextprotocol/python-sdk · GitHub
Open Graph Title: Return METHOD_NOT_FOUND for invalid request methods by raashish1601 · Pull Request #2372 · modelcontextprotocol/python-sdk
X Title: Return METHOD_NOT_FOUND for invalid request methods by raashish1601 · Pull Request #2372 · modelcontextprotocol/python-sdk
Description: Fixes #1561. Summary return METHOD_NOT_FOUND for unknown JSON-RPC request methods instead of collapsing them into the generic request-validation INVALID_PARAMS fallback keep INVALID_PARAMS for malformed known methods by only special-casing method names that are outside the typed client request union add a focused regression proving invalid/method returns -32601 while malformed initialize still returns -32602 Testing PYTHONPATH=src python -m pytest -o addopts="" tests/issues/test_1561_invalid_method_names.py -q python -m ruff check src/mcp/shared/session.py src/mcp/server/session.py tests/issues/test_1561_invalid_method_names.py git diff --check
Open Graph Description: Fixes #1561. Summary return METHOD_NOT_FOUND for unknown JSON-RPC request methods instead of collapsing them into the generic request-validation INVALID_PARAMS fallback keep INVALID_PARAMS for mal...
X Description: Fixes #1561. Summary return METHOD_NOT_FOUND for unknown JSON-RPC request methods instead of collapsing them into the generic request-validation INVALID_PARAMS fallback keep INVALID_PARAMS for mal...
Opengraph URL: https://github.com/modelcontextprotocol/python-sdk/pull/2372
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:63db8fae-821e-fda0-8d44-7e75c92e6c9d |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | E744:38F1CF:18BB346:208D36E:6A5C72E4 |
| html-safe-nonce | 2e1f59a2cf8fa8e5e20c7001a57ff86ec9992c75864bdf755ef367f15482a1bc |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNzQ0OjM4RjFDRjoxOEJCMzQ2OjIwOEQzNkU6NkE1QzcyRTQiLCJ2aXNpdG9yX2lkIjoiNjAxNTQ3MDc4Nzg0NzAyNTM4MCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | d3a505696de955f20fb8647d6cb064ff306776cd8326b296d491b8e126f82cc7 |
| hovercard-subject-tag | pull_request:3460847842 |
| 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/2372/files |
| twitter:image | https://avatars.githubusercontent.com/u/94279692?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/94279692?s=400&v=4 |
| og:image:alt | Fixes #1561. Summary return METHOD_NOT_FOUND for unknown JSON-RPC request methods instead of collapsing them into the generic request-validation INVALID_PARAMS fallback keep INVALID_PARAMS for mal... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5290d7e14309ad1e76106a9c4237bd1041517e83ea182c8ab756752cb0c6940b |
| 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 | 9c975978430e9ad293956f2bbdaf153b1bd84a99 |
| ui-target | canary-2 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width