Title: Support custom method handlers with custom params and return types on MCPServer · Issue #2105 · modelcontextprotocol/python-sdk · GitHub
Open Graph Title: Support custom method handlers with custom params and return types on MCPServer · Issue #2105 · modelcontextprotocol/python-sdk
X Title: Support custom method handlers with custom params and return types on MCPServer · Issue #2105 · modelcontextprotocol/python-sdk
Description: The SDK should provide a clear, documented way to register custom JSON-RPC method handlers on the server side that can: Receive custom parameter types — not just the built-in MCP request types, but arbitrary structured params (dicts, Pyd...
Open Graph Description: The SDK should provide a clear, documented way to register custom JSON-RPC method handlers on the server side that can: Receive custom parameter types — not just the built-in MCP request types, but...
X Description: The SDK should provide a clear, documented way to register custom JSON-RPC method handlers on the server side that can: Receive custom parameter types — not just the built-in MCP request types, but...
Opengraph URL: https://github.com/modelcontextprotocol/python-sdk/issues/2105
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Support custom method handlers with custom params and return types on MCPServer","articleBody":"The SDK should provide a clear, documented way to register custom JSON-RPC method handlers on the server side that can:\n\n1. **Receive custom parameter types** — not just the built-in MCP request types, but arbitrary structured params (dicts, Pydantic models, etc.)\n2. **Return custom response types** — not just the built-in MCP result types\n\nThis is important for:\n- Protocol extensions and experimentation\n- Custom server-to-server communication patterns\n- Future spec features (e.g., MRTR) that may introduce new method/response types\n\nThe low-level server was recently refactored to use `on_*` constructor kwargs (PR #1985), which gives a cleaner handler registration pattern. This issue is about making sure there is an explicit, documented escape hatch for methods that are not part of the core MCP spec.\n\n### Open questions\n- Should custom handlers go through the same `on_*` pattern, or a separate `register_method()` API?\n- How do custom params get validated/parsed?\n- How does this interact with middleware (#1233)?\n\nRef: V2 planning discussion","author":{"url":"https://github.com/maxisbey","@type":"Person","name":"maxisbey"},"datePublished":"2026-02-19T20:12:33.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/2105/python-sdk/issues/2105"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:4d7df810-72e9-0dce-abc9-63f6035bc627 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C8C8:289D0C:CD0136:1103B59:6A5B5A4F |
| html-safe-nonce | 8f94a04b60ee621fc7787b5b318037357e4cc26e5b9120c275eeba2bf92bab61 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDOEM4OjI4OUQwQzpDRDAxMzY6MTEwM0I1OTo2QTVCNUE0RiIsInZpc2l0b3JfaWQiOiI3OTI5OTQwMzM5NjQxMjQ0MjM5IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 4bea4fce82af1771494aa7d80300ad4d9c95fd6b812488ede722be86828555ab |
| hovercard-subject-tag | issue:3964872609 |
| github-keyboard-shortcuts | repository,issues,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/_view_fragments/issues/show/modelcontextprotocol/python-sdk/2105/issue_layout |
| twitter:image | https://opengraph.githubassets.com/8b4b115ece749aaa91e8b8812d1ff01eb4f0666d6100bd19e6c85fc88e075da9/modelcontextprotocol/python-sdk/issues/2105 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/8b4b115ece749aaa91e8b8812d1ff01eb4f0666d6100bd19e6c85fc88e075da9/modelcontextprotocol/python-sdk/issues/2105 |
| og:image:alt | The SDK should provide a clear, documented way to register custom JSON-RPC method handlers on the server side that can: Receive custom parameter types — not just the built-in MCP request types, but... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | maxisbey |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5290d7e14309ad1e76106a9c4237bd1041517e83ea182c8ab756752cb0c6940b |
| turbo-cache-control | no-preview |
| 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 |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 9c975978430e9ad293956f2bbdaf153b1bd84a99 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width