René's URL Explorer Experiment


Title: find_context_parameter treats a Context return annotation as a parameter · Issue #3298 · modelcontextprotocol/python-sdk · GitHub

Open Graph Title: find_context_parameter treats a Context return annotation as a parameter · Issue #3298 · modelcontextprotocol/python-sdk

X Title: find_context_parameter treats a Context return annotation as a parameter · Issue #3298 · modelcontextprotocol/python-sdk

Description: Initial checks I tested the current main branch (6e30452). I searched existing issues and pull requests for this behavior. Description find_context_parameter() iterates over every entry returned by typing.get_type_hints(). That mapping i...

Open Graph Description: Initial checks I tested the current main branch (6e30452). I searched existing issues and pull requests for this behavior. Description find_context_parameter() iterates over every entry returned by...

X Description: Initial checks I tested the current main branch (6e30452). I searched existing issues and pull requests for this behavior. Description find_context_parameter() iterates over every entry returned by...

Opengraph URL: https://github.com/modelcontextprotocol/python-sdk/issues/3298

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.114.3


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"find_context_parameter treats a Context return annotation as a parameter","articleBody":"### Initial checks\n\n- [x] I tested the current `main` branch (`6e30452`).\n- [x] I searched existing issues and pull requests for this behavior.\n\n### Description\n\n`find_context_parameter()` iterates over every entry returned by `typing.get_type_hints()`. That mapping includes the function return annotation under the special key `\"return\"`, even though it is not a parameter.\n\nAs a result, a tool, prompt, or resource function whose return annotation is `Context` (or a union containing `Context`) is incorrectly recorded as having a context parameter named `\"return\"`. The SDK later attempts to inject context as a keyword argument with that name, which can produce an unexpected-keyword error when the callable is invoked.\n\nExpected: context detection only examines actual function parameters and ignores the return annotation.\n\n### Example code\n\n```python\nfrom mcp.server.mcpserver import Context\nfrom mcp.server.mcpserver.utilities.context_injection import find_context_parameter\n\ndef fn(value: int) -> Context:\n    ...\n\nprint(find_context_parameter(fn))  # current: \"return\"; expected: None\n```\n\n### Environment\n\n- Python 3.12\n- MCP Python SDK `main` at `6e30452`\n\nI used AI assistance while investigating this issue and reviewed and reproduced the behavior locally.\n","author":{"url":"https://github.com/otiscuilei","@type":"Person","name":"otiscuilei"},"datePublished":"2026-08-12T12:19:25Z","url":"https://github.com/modelcontextprotocol/python-sdk/issues/3298"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:cde739ed-6b47-a519-73c0-4fb56a71dfec
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idAFEC:19330E:194762E:217BEB1:6B0568AC
html-safe-nonce1a529e340c0d30382552ff1c9051598a6950a220789786c6790bcb2e4409fb81
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBRkVDOjE5MzMwRToxOTQ3NjJFOjIxN0JFQjE6NkIwNTY4QUMiLCJ2aXNpdG9yX2lkIjoiMjg1MDI3NjMxMjQ0NTQ0NjMxNiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmacb70f4c4e18b87f79cec21c12bdfa978864c88b5d6c80673c210f0a1d443285dc
hovercard-subject-tagissue:5130796572
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/modelcontextprotocol/python-sdk/3298/issue_layout
twitter:imagehttps://opengraph.githubassets.com/7e1c4a57c637edc946740c4bf98b0a095a13c72e9c3b263a62114b4657c10c5f/modelcontextprotocol/python-sdk/issues/3298
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/7e1c4a57c637edc946740c4bf98b0a095a13c72e9c3b263a62114b4657c10c5f/modelcontextprotocol/python-sdk/issues/3298
og:image:altInitial checks I tested the current main branch (6e30452). I searched existing issues and pull requests for this behavior. Description find_context_parameter() iterates over every entry returned by...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameotiscuilei
hostnamegithub.com
expected-hostnamegithub.com
None1be5cc09efdd4833c24a4ffa71d698e3999fa09071e159fe14c2c08e41c98331
turbo-cache-controlno-preview
go-importgithub.com/modelcontextprotocol/python-sdk git https://github.com/modelcontextprotocol/python-sdk.git
octolytics-dimension-user_id182288589
octolytics-dimension-user_loginmodelcontextprotocol
octolytics-dimension-repository_id862584018
octolytics-dimension-repository_nwomodelcontextprotocol/python-sdk
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id862584018
octolytics-dimension-repository_network_root_nwomodelcontextprotocol/python-sdk
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releasef6d69234e682c947a48074340e69d45d5901de31
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/modelcontextprotocol/python-sdk/issues/3298#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmodelcontextprotocol%2Fpython-sdk%2Fissues%2F3298
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmodelcontextprotocol%2Fpython-sdk%2Fissues%2F3298
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=modelcontextprotocol%2Fpython-sdk
Reloadhttps://github.com/modelcontextprotocol/python-sdk/issues/3298
Reloadhttps://github.com/modelcontextprotocol/python-sdk/issues/3298
Reloadhttps://github.com/modelcontextprotocol/python-sdk/issues/3298
modelcontextprotocolhttps://github.com/modelcontextprotocol
python-sdkhttps://github.com/modelcontextprotocol/python-sdk
Codehttps://github.com/modelcontextprotocol/python-sdk
Issues320 (320)https://github.com/modelcontextprotocol/python-sdk/issues
Pull requests112 (112)https://github.com/modelcontextprotocol/python-sdk/pulls
Actionshttps://github.com/modelcontextprotocol/python-sdk/actions
Projectshttps://github.com/modelcontextprotocol/python-sdk/projects
Security and quality12 (12)https://github.com/modelcontextprotocol/python-sdk/security
Insightshttps://github.com/modelcontextprotocol/python-sdk/insights
https://github.com/modelcontextprotocol/python-sdk
New issuehttps://github.com/login?return_to=https://github.com/modelcontextprotocol/python-sdk/issues/3298
New issuehttps://github.com/login?return_to=https://github.com/modelcontextprotocol/python-sdk/issues/3298
find_context_parameter treats a Context return annotation as a parameterhttps://github.com/modelcontextprotocol/python-sdk/issues/3298#top
P3https://github.com/modelcontextprotocol/python-sdk/issues?q=state%3Aopen%20label%3A%22P3%22
bughttps://github.com/modelcontextprotocol/python-sdk/issues?q=state%3Aopen%20label%3A%22bug%22
v1https://github.com/modelcontextprotocol/python-sdk/issues?q=state%3Aopen%20label%3A%22v1%22
v2https://github.com/modelcontextprotocol/python-sdk/issues?q=state%3Aopen%20label%3A%22v2%22
https://github.com/otiscuilei
otiscuileihttps://github.com/otiscuilei
on Aug 12, 2026https://github.com/modelcontextprotocol/python-sdk/issues/3298#issue-5130796572
https://github.com/nightcityblade
nightcitybladehttps://github.com/nightcityblade
on Aug 12, 2026https://github.com/modelcontextprotocol/python-sdk/issues/3298#issuecomment-5268616661
https://github.com/nightcityblade
nightcitybladehttps://github.com/nightcityblade
on Aug 12, 2026https://github.com/modelcontextprotocol/python-sdk/issues/3298#issuecomment-5268634298
maxisbeyhttps://github.com/maxisbey
P3https://github.com/modelcontextprotocol/python-sdk/issues?q=state%3Aopen%20label%3A%22P3%22
on Aug 12, 2026https://github.com/modelcontextprotocol/python-sdk/issues/3298#event-29354940505
https://github.com/hishammoizuddin
hishammoizuddinhttps://github.com/hishammoizuddin
on Aug 13, 2026https://github.com/modelcontextprotocol/python-sdk/issues/3298#issuecomment-5277120720
maxisbeyhttps://github.com/maxisbey
v1https://github.com/modelcontextprotocol/python-sdk/issues?q=state%3Aopen%20label%3A%22v1%22
v2https://github.com/modelcontextprotocol/python-sdk/issues?q=state%3Aopen%20label%3A%22v2%22
on Aug 18, 2026https://github.com/modelcontextprotocol/python-sdk/issues/3298#event-29625178973
https://github.com/CodeAlex52
CodeAlex52https://github.com/CodeAlex52
on Sep 10, 2026https://github.com/modelcontextprotocol/python-sdk/issues/3298#issuecomment-5613432975
https://github.com/Drima-code
Drima-codehttps://github.com/Drima-code
on Sep 16, 2026https://github.com/modelcontextprotocol/python-sdk/issues/3298#issuecomment-5690286854
Drima-code@f37be04https://github.com/Drima-code/python-sdk/commit/f37be04
claudehttps://github.com/apps/claude
bughttps://github.com/modelcontextprotocol/python-sdk/issues?q=state%3Aopen%20label%3A%22bug%22
on Oct 8, 2026https://github.com/modelcontextprotocol/python-sdk/issues/3298#event-32781083898
Sign up for freehttps://github.com/signup?return_to=https://github.com/modelcontextprotocol/python-sdk/issues/3298
Sign in to commenthttps://github.com/login?return_to=https://github.com/modelcontextprotocol/python-sdk/issues/3298
P3https://github.com/modelcontextprotocol/python-sdk/issues?q=state%3Aopen%20label%3A%22P3%22
bughttps://github.com/modelcontextprotocol/python-sdk/issues?q=state%3Aopen%20label%3A%22bug%22
v1https://github.com/modelcontextprotocol/python-sdk/issues?q=state%3Aopen%20label%3A%22v1%22
v2https://github.com/modelcontextprotocol/python-sdk/issues?q=state%3Aopen%20label%3A%22v2%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Response headers:
Servergithub.com
Content-Typetext/html; charset=utf-8
Cache-Controlmax-age=0, private, must-revalidate

Viewport: width=device-width


URLs of crawlers that visited me.