| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:b7c4b25b-598f-14f8-87a6-892f82c715fb |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | 96F0:265E5B:1C78327:25F6F1D:6A5D4E7B |
| html-safe-nonce | d438cda9dca4c4a2ea2633997b181e8509ac0dc1244bddcf8c81f07ea19d7f2f |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NkYwOjI2NUU1QjoxQzc4MzI3OjI1RjZGMUQ6NkE1RDRFN0IiLCJ2aXNpdG9yX2lkIjoiNjYwNjUzMDM2NTkxNzg0MzA2NyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | b7f53a7dc001881ac77124ab2078c31a481a60caaf31abde584182cf37140e62 |
| hovercard-subject-tag | pull_request:3218864104 |
| 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 | ///pull_requests/show/files |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/modelcontextprotocol/python-sdk/pull/1968/files |
| twitter:image | https://avatars.githubusercontent.com/u/224885523?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/224885523?s=400&v=4 |
| og:image:alt | Replaces decorator-based handler registration with RequestHandler/NotificationHandler classes.
Changes
New files: request_handler.py and notification_handler.py with typed overloaded constructors
... |
| 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 | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| Skip to content | https://github.com/modelcontextprotocol/python-sdk/pull/1968/files#start-of-content |
|
| https://github.com/ |
|
Sign in
| https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmodelcontextprotocol%2Fpython-sdk%2Fpull%2F1968%2Ffiles |
| GitHub CopilotWrite better code with AI | https://github.com/features/copilot |
| GitHub Copilot appDirect agents from issue to merge | https://github.com/features/ai/github-app |
| MCP RegistryNewIntegrate external tools | https://github.com/mcp |
| ActionsAutomate any workflow | https://github.com/features/actions |
| CodespacesInstant dev environments | https://github.com/features/codespaces |
| IssuesPlan and track work | https://github.com/features/issues |
| Code ReviewManage code changes | https://github.com/features/code-review |
| GitHub Advanced SecurityFind and fix vulnerabilities | https://github.com/security/advanced-security |
| Code securitySecure your code as you build | https://github.com/security/advanced-security/code-security |
| Secret protectionStop leaks before they start | https://github.com/security/advanced-security/secret-protection |
| Why GitHub | https://github.com/why-github |
| Documentation | https://docs.github.com |
| Blog | https://github.blog |
| Changelog | https://github.blog/changelog |
| Marketplace | https://github.com/marketplace |
| View all features | https://github.com/features |
| Enterprises | https://github.com/enterprise |
| Small and medium teams | https://github.com/team |
| Startups | https://github.com/enterprise/startups |
| Nonprofits | https://github.com/solutions/industry/nonprofits |
| App Modernization | https://github.com/solutions/use-case/app-modernization |
| DevSecOps | https://github.com/solutions/use-case/devsecops |
| DevOps | https://github.com/solutions/use-case/devops |
| CI/CD | https://github.com/solutions/use-case/ci-cd |
| View all use cases | https://github.com/solutions/use-case |
| Healthcare | https://github.com/solutions/industry/healthcare |
| Financial services | https://github.com/solutions/industry/financial-services |
| Manufacturing | https://github.com/solutions/industry/manufacturing |
| Government | https://github.com/solutions/industry/government |
| View all industries | https://github.com/solutions/industry |
| View all solutions | https://github.com/solutions |
| AI | https://github.com/resources/articles?topic=ai |
| Software Development | https://github.com/resources/articles?topic=software-development |
| DevOps | https://github.com/resources/articles?topic=devops |
| Security | https://github.com/resources/articles?topic=security |
| View all topics | https://github.com/resources/articles |
| Customer stories | https://github.com/customer-stories |
| Events & webinars | https://github.com/resources/events |
| Ebooks & reports | https://github.com/resources/whitepapers |
| Business insights | https://github.com/solutions/executive-insights |
| GitHub Skills | https://skills.github.com |
| Documentation | https://docs.github.com |
| Customer support | https://support.github.com |
| Community forum | https://github.com/orgs/community/discussions |
| Trust center | https://github.com/trust-center |
| Partners | https://github.com/partners |
| View all resources | https://github.com/resources |
| GitHub SponsorsFund open source developers | https://github.com/open-source/sponsors |
| Security Lab | https://securitylab.github.com |
| Maintainer Community | https://maintainers.github.com |
| Accelerator | https://github.com/open-source/accelerator |
| GitHub Stars | https://stars.github.com |
| Archive Program | https://archiveprogram.github.com |
| Topics | https://github.com/topics |
| Trending | https://github.com/trending |
| Collections | https://github.com/collections |
| Enterprise platformAI-powered developer platform | https://github.com/enterprise |
| GitHub Advanced SecurityEnterprise-grade security features | https://github.com/security/advanced-security |
| Copilot for BusinessEnterprise-grade AI features | https://github.com/features/copilot/copilot-business |
| Premium SupportEnterprise-grade 24/7 support | https://github.com/enterprise/premium-support |
| Pricing | https://github.com/pricing |
| Search syntax tips | https://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax |
| documentation | https://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax |
|
Sign in
| https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmodelcontextprotocol%2Fpython-sdk%2Fpull%2F1968%2Ffiles |
|
Sign up
| https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=modelcontextprotocol%2Fpython-sdk |
| Reload | https://github.com/modelcontextprotocol/python-sdk/pull/1968/files |
| Reload | https://github.com/modelcontextprotocol/python-sdk/pull/1968/files |
| Reload | https://github.com/modelcontextprotocol/python-sdk/pull/1968/files |
| Please reload this page | https://github.com/modelcontextprotocol/python-sdk/pull/1968/files |
|
modelcontextprotocol
| https://github.com/modelcontextprotocol |
| python-sdk | https://github.com/modelcontextprotocol/python-sdk |
|
Notifications
| https://github.com/login?return_to=%2Fmodelcontextprotocol%2Fpython-sdk |
|
Fork
3.7k
| https://github.com/login?return_to=%2Fmodelcontextprotocol%2Fpython-sdk |
|
Star
23.7k
| https://github.com/login?return_to=%2Fmodelcontextprotocol%2Fpython-sdk |
|
Code
| https://github.com/modelcontextprotocol/python-sdk |
|
Issues
261
| https://github.com/modelcontextprotocol/python-sdk/issues |
|
Pull requests
308
| https://github.com/modelcontextprotocol/python-sdk/pulls |
|
Actions
| https://github.com/modelcontextprotocol/python-sdk/actions |
|
Projects
| https://github.com/modelcontextprotocol/python-sdk/projects |
|
Models
| https://github.com/modelcontextprotocol/python-sdk/models |
|
Security and quality
6
| https://github.com/modelcontextprotocol/python-sdk/security |
|
Insights
| https://github.com/modelcontextprotocol/python-sdk/pulse |
|
Code
| https://github.com/modelcontextprotocol/python-sdk |
|
Issues
| https://github.com/modelcontextprotocol/python-sdk/issues |
|
Pull requests
| https://github.com/modelcontextprotocol/python-sdk/pulls |
|
Actions
| https://github.com/modelcontextprotocol/python-sdk/actions |
|
Projects
| https://github.com/modelcontextprotocol/python-sdk/projects |
|
Models
| https://github.com/modelcontextprotocol/python-sdk/models |
|
Security and quality
| https://github.com/modelcontextprotocol/python-sdk/security |
|
Insights
| https://github.com/modelcontextprotocol/python-sdk/pulse |
| Sign up for GitHub
| https://github.com/signup?return_to=%2Fmodelcontextprotocol%2Fpython-sdk%2Fissues%2Fnew%2Fchoose |
| terms of service | https://docs.github.com/terms |
| privacy statement | https://docs.github.com/privacy |
| Sign in | https://github.com/login?return_to=%2Fmodelcontextprotocol%2Fpython-sdk%2Fissues%2Fnew%2Fchoose |
| maxisbey | https://github.com/maxisbey |
| main | https://github.com/modelcontextprotocol/python-sdk/tree/main |
| sketch/lowlevel-server-v2 | https://github.com/modelcontextprotocol/python-sdk/tree/sketch/lowlevel-server-v2 |
|
Conversation
49
| https://github.com/modelcontextprotocol/python-sdk/pull/1968 |
|
Commits
17
| https://github.com/modelcontextprotocol/python-sdk/pull/1968/commits |
|
Checks
29
| https://github.com/modelcontextprotocol/python-sdk/pull/1968/checks |
|
Files changed
| https://github.com/modelcontextprotocol/python-sdk/pull/1968/files |
| Please reload this page | https://github.com/modelcontextprotocol/python-sdk/pull/1968/files |
|
sketch: refactor lowlevel server to handler pattern
| https://github.com/modelcontextprotocol/python-sdk/pull/1968/files#top |
|
Show all changes
17 commits
| https://github.com/modelcontextprotocol/python-sdk/pull/1968/files |
|
ec9815f
sketch: lowlevel server v2 with overloaded handler classes
maxisbey Jan 27, 2026
| https://github.com/modelcontextprotocol/python-sdk/pull/1968/commits/ec9815f636677549c94d6b1f5481bb04ee76c457 |
|
eb35b3c
refactor: replace decorator-based handlers with RequestHandler/Notifi…
maxisbey Jan 28, 2026
| https://github.com/modelcontextprotocol/python-sdk/pull/1968/commits/eb35b3ca8c1668e1cf9beceff1d5776d529142da |
|
0b60fad
refactor: split RequestContext into handler context hierarchy
maxisbey Jan 28, 2026
| https://github.com/modelcontextprotocol/python-sdk/pull/1968/commits/0b60fad14c0255750e846f4ee7e820ebf646225a |
|
bed7e3c
rename: self.endpoint -> self.handler in handler classes
maxisbey Jan 28, 2026
| https://github.com/modelcontextprotocol/python-sdk/pull/1968/commits/bed7e3c8d0c907d8f6725f3e253bfcdacb0b9299 |
|
860e8d6
refactor: decouple ExperimentalHandlers from Server internals, update…
maxisbey Jan 28, 2026
| https://github.com/modelcontextprotocol/python-sdk/pull/1968/commits/860e8d6e9465542c10451770d5ea3f0d021517b8 |
|
17c459c
refactor: update MCPServer to use RequestHandler pattern instead of d…
maxisbey Jan 28, 2026
| https://github.com/modelcontextprotocol/python-sdk/pull/1968/commits/17c459c4e53e10f00c7b248a857509a328068d0c |
|
8100870
refactor: collapse context hierarchy into single RequestContext class
maxisbey Jan 28, 2026
| https://github.com/modelcontextprotocol/python-sdk/pull/1968/commits/8100870fb60f9395a794e439d59a2f3c3a81a783 |
|
d5c3b5f
refactor: move _ping_handler below Server class
maxisbey Jan 28, 2026
| https://github.com/modelcontextprotocol/python-sdk/pull/1968/commits/d5c3b5fd26549a9835d1d26c72cf9d286f61cc86 |
|
952a29c
refactor: merge request_handler.py and notification_handler.py into h…
maxisbey Jan 28, 2026
| https://github.com/modelcontextprotocol/python-sdk/pull/1968/commits/952a29cc389a10ea34b719d26830dd7250d52f49 |
|
6f0b041
refactor: move request_ctx contextvar to lowlevel server, remove per-…
maxisbey Jan 28, 2026
| https://github.com/modelcontextprotocol/python-sdk/pull/1968/commits/6f0b041662ff219ad8bc8c8127b61258c9b951af |
|
aa6d861
docs: fix migration guide — request_ctx contextvar still exists
maxisbey Jan 28, 2026
| https://github.com/modelcontextprotocol/python-sdk/pull/1968/commits/aa6d861257fe196b90f00818f3b0d77b8842c4a0 |
|
24f1f39
docs: fix stale examples in migration guide
maxisbey Jan 28, 2026
| https://github.com/modelcontextprotocol/python-sdk/pull/1968/commits/24f1f39bf4cdbbd3fa59ab9da308331128411652 |
|
8eb7299
refactor: address review — kw_only dataclass, type Experimental prope…
maxisbey Jan 29, 2026
| https://github.com/modelcontextprotocol/python-sdk/pull/1968/commits/8eb72990bdc9401111f0fde3b72ff5c170a7aecc |
|
cafb3e5
fix: allow ping handler override, add task overloads, update stale do…
maxisbey Jan 29, 2026
| https://github.com/modelcontextprotocol/python-sdk/pull/1968/commits/cafb3e505ec63e823479fa8da7b744324b95ed9d |
|
4255a99
docs: move lowlevel server sections to Breaking Changes in migration …
maxisbey Jan 29, 2026
| https://github.com/modelcontextprotocol/python-sdk/pull/1968/commits/4255a996733d7577e2103a8e4c06488439bba494 |
|
044e128
Update src/mcp/server/lowlevel/__init__.py
maxisbey Jan 30, 2026
| https://github.com/modelcontextprotocol/python-sdk/pull/1968/commits/044e12813b0da9f5d510d6cff829b7e014dc84de |
|
f10995e
refactor: remove request_ctx from lowlevel public API, fix experiment…
maxisbey Jan 30, 2026
| https://github.com/modelcontextprotocol/python-sdk/pull/1968/commits/f10995ed9810fd62f456ee2b5c3028e763ad05e0 |
|
Clear filters
| https://github.com/modelcontextprotocol/python-sdk/pull/1968/files |
| Please reload this page | https://github.com/modelcontextprotocol/python-sdk/pull/1968/files |
| Please reload this page | https://github.com/modelcontextprotocol/python-sdk/pull/1968/files |
|
index.md
| https://github.com/modelcontextprotocol/python-sdk/pull/1968/files#diff-9fdad40404ae06571e2184d17271a7cbe176853a3066edde9479316a02e702b3 |
|
migration.md
| https://github.com/modelcontextprotocol/python-sdk/pull/1968/files#diff-758ba107a728fccfdf0d098b2c06ded59127dd53ea287d630f72fb51040bc72d |
|
request_context.py
| https://github.com/modelcontextprotocol/python-sdk/pull/1968/files#diff-8d05f99b9f074e62f6f7dc4eb823393ef4218b9c2a7c5b4b966f941055e5242d |
|
task_result_handler.py
| https://github.com/modelcontextprotocol/python-sdk/pull/1968/files#diff-18b65113e22e1d5975f5a057cd352f32f933adaf3cd9c4484a8b40521298c223 |
|
__init__.py
| https://github.com/modelcontextprotocol/python-sdk/pull/1968/files#diff-23afa7c38ae84d72d250bef2c82600dea679b780385858d1f71047a5fa04e218 |
|
experimental.py
| https://github.com/modelcontextprotocol/python-sdk/pull/1968/files#diff-3e62e66c84aff2e748e8c750f1144de569f6e6e0fe2b9a45ab39794032b10b92 |
|
handler.py
| https://github.com/modelcontextprotocol/python-sdk/pull/1968/files#diff-dafaa033c6bf87c0e004dc6c140c8d0bd7ea12bb10c15b39c37ae35a52c8d80e |
|
server.py
| https://github.com/modelcontextprotocol/python-sdk/pull/1968/files#diff-b21bf5e21c058ccfddb404c209f2d4288e4f32b121111ffc9d466638631d13e4 |
|
server.py
| https://github.com/modelcontextprotocol/python-sdk/pull/1968/files#diff-51d6996c0b80b8a5c42e7071451cb9ed3c91b398facebe99b94aad911059190e |
|
context.py
| https://github.com/modelcontextprotocol/python-sdk/pull/1968/files#diff-39333468a87a8b7df9e7916239f97203647716e5465b846328ec277e179c7ceb |
|
helpers.py
| https://github.com/modelcontextprotocol/python-sdk/pull/1968/files#diff-1827c4e0b8b733a2e711d40022010f1d2872465203de61fd7a8ac77b2c966226 |
| docs/experimental/index.md | https://github.com/modelcontextprotocol/python-sdk/pull/1968/files#diff-9fdad40404ae06571e2184d17271a7cbe176853a3066edde9479316a02e702b3 |
|
View file
| https://github.com/modelcontextprotocol/python-sdk/blob/f10995ed9810fd62f456ee2b5c3028e763ad05e0/docs/experimental/index.md |
|
Open in desktop
| https://desktop.github.com |
| https://github.co/hiddenchars |
| https://github.com/modelcontextprotocol/python-sdk/pull/1968/{{ revealButtonHref }} |
|
| https://github.com/modelcontextprotocol/python-sdk/pull/1968/files#diff-9fdad40404ae06571e2184d17271a7cbe176853a3066edde9479316a02e702b3 |
|
| https://github.com/modelcontextprotocol/python-sdk/pull/1968/files#diff-9fdad40404ae06571e2184d17271a7cbe176853a3066edde9479316a02e702b3 |
| docs/migration.md | https://github.com/modelcontextprotocol/python-sdk/pull/1968/files#diff-758ba107a728fccfdf0d098b2c06ded59127dd53ea287d630f72fb51040bc72d |
|
View file
| https://github.com/modelcontextprotocol/python-sdk/blob/f10995ed9810fd62f456ee2b5c3028e763ad05e0/docs/migration.md |
|
Open in desktop
| https://desktop.github.com |
| https://github.co/hiddenchars |
| https://github.com/modelcontextprotocol/python-sdk/pull/1968/{{ revealButtonHref }} |
|
| https://github.com/modelcontextprotocol/python-sdk/pull/1968/files#diff-758ba107a728fccfdf0d098b2c06ded59127dd53ea287d630f72fb51040bc72d |
|
| https://github.com/modelcontextprotocol/python-sdk/pull/1968/files#diff-758ba107a728fccfdf0d098b2c06ded59127dd53ea287d630f72fb51040bc72d |
|
| https://github.com/modelcontextprotocol/python-sdk/pull/1968/files#diff-758ba107a728fccfdf0d098b2c06ded59127dd53ea287d630f72fb51040bc72d |
|
| https://github.com/modelcontextprotocol/python-sdk/pull/1968/files#diff-758ba107a728fccfdf0d098b2c06ded59127dd53ea287d630f72fb51040bc72d |
|
| https://github.com/modelcontextprotocol/python-sdk/pull/1968/files#diff-758ba107a728fccfdf0d098b2c06ded59127dd53ea287d630f72fb51040bc72d |
|
| https://github.com/modelcontextprotocol/python-sdk/pull/1968/files#diff-758ba107a728fccfdf0d098b2c06ded59127dd53ea287d630f72fb51040bc72d |
|
| https://github.com/modelcontextprotocol/python-sdk/pull/1968/files#diff-758ba107a728fccfdf0d098b2c06ded59127dd53ea287d630f72fb51040bc72d |
| src/mcp/server/experimental/request_context.py | https://github.com/modelcontextprotocol/python-sdk/pull/1968/files#diff-8d05f99b9f074e62f6f7dc4eb823393ef4218b9c2a7c5b4b966f941055e5242d |
|
View file
| https://github.com/modelcontextprotocol/python-sdk/blob/f10995ed9810fd62f456ee2b5c3028e763ad05e0/src/mcp/server/experimental/request_context.py |
|
Open in desktop
| https://desktop.github.com |
| https://github.co/hiddenchars |
| https://github.com/modelcontextprotocol/python-sdk/pull/1968/{{ revealButtonHref }} |
|
| https://github.com/modelcontextprotocol/python-sdk/pull/1968/files#diff-8d05f99b9f074e62f6f7dc4eb823393ef4218b9c2a7c5b4b966f941055e5242d |
|
| https://github.com/modelcontextprotocol/python-sdk/pull/1968/files#diff-8d05f99b9f074e62f6f7dc4eb823393ef4218b9c2a7c5b4b966f941055e5242d |
| src/mcp/server/experimental/task_result_handler.py | https://github.com/modelcontextprotocol/python-sdk/pull/1968/files#diff-18b65113e22e1d5975f5a057cd352f32f933adaf3cd9c4484a8b40521298c223 |
|
View file
| https://github.com/modelcontextprotocol/python-sdk/blob/f10995ed9810fd62f456ee2b5c3028e763ad05e0/src/mcp/server/experimental/task_result_handler.py |
|
Open in desktop
| https://desktop.github.com |
| https://github.co/hiddenchars |
| https://github.com/modelcontextprotocol/python-sdk/pull/1968/{{ revealButtonHref }} |
|
| https://github.com/modelcontextprotocol/python-sdk/pull/1968/files#diff-18b65113e22e1d5975f5a057cd352f32f933adaf3cd9c4484a8b40521298c223 |
|
| https://github.com/modelcontextprotocol/python-sdk/pull/1968/files#diff-18b65113e22e1d5975f5a057cd352f32f933adaf3cd9c4484a8b40521298c223 |
| src/mcp/server/lowlevel/__init__.py | https://github.com/modelcontextprotocol/python-sdk/pull/1968/files#diff-23afa7c38ae84d72d250bef2c82600dea679b780385858d1f71047a5fa04e218 |
|
View file
| https://github.com/modelcontextprotocol/python-sdk/blob/f10995ed9810fd62f456ee2b5c3028e763ad05e0/src/mcp/server/lowlevel/__init__.py |
|
Open in desktop
| https://desktop.github.com |
| https://github.co/hiddenchars |
| https://github.com/modelcontextprotocol/python-sdk/pull/1968/{{ revealButtonHref }} |
| Please reload this page | https://github.com/modelcontextprotocol/python-sdk/pull/1968/files |
| Please reload this page | https://github.com/modelcontextprotocol/python-sdk/pull/1968/files |
|
| https://github.com |
| Terms | https://docs.github.com/site-policy/github-terms/github-terms-of-service |
| Privacy | https://docs.github.com/site-policy/privacy-policies/github-privacy-statement |
| Security | https://github.com/security |
| Status | https://www.githubstatus.com/ |
| Community | https://github.community/ |
| Docs | https://docs.github.com/ |
| Contact | https://support.github.com?tags=dotcom-footer |