René's URL Explorer Experiment


Title: PydanticSchemaGenerationError: Unable to generate pydantic-core schema for Image type · Issue #1060 · modelcontextprotocol/python-sdk · GitHub

Open Graph Title: PydanticSchemaGenerationError: Unable to generate pydantic-core schema for Image type · Issue #1060 · modelcontextprotocol/python-sdk

X Title: PydanticSchemaGenerationError: Unable to generate pydantic-core schema for Image type · Issue #1060 · modelcontextprotocol/python-sdk

Description: Initial Checks I confirm that I'm using the latest version of MCP Python SDK I confirm that I searched for my issue in https://github.com/modelcontextprotocol/python-sdk/issues before opening this issue Description The Image type in ques...

Open Graph Description: Initial Checks I confirm that I'm using the latest version of MCP Python SDK I confirm that I searched for my issue in https://github.com/modelcontextprotocol/python-sdk/issues before opening this ...

X Description: Initial Checks I confirm that I'm using the latest version of MCP Python SDK I confirm that I searched for my issue in https://github.com/modelcontextprotocol/python-sdk/issues before opening t...

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

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":"PydanticSchemaGenerationError: Unable to generate pydantic-core schema for Image type","articleBody":"### Initial Checks\n\n- [x] I confirm that I'm using the latest version of MCP Python SDK\n- [x] I confirm that I searched for my issue in https://github.com/modelcontextprotocol/python-sdk/issues before opening this issue\n\n### Description\n\nThe `Image` type in question is imported like this: `from mcp.server.fastmcp.utilities.types import Image`\n\nWe are upgrading our dependency on `mcp` from 1.9.4 to 1.10.1.\n\nOnce on 1.10.1 our application and tests began to fail with error like this:\n```\npydantic.errors.PydanticSchemaGenerationError: Unable to generate pydantic-core schema\nfor \u003cclass 'mcp.server.fastmcp.utilities.types.Image'>. Set `arbitrary_types_allowed=True` in\nthe model_config to ignore this error or implement `__get_pydantic_core_schema__` on your\ntype to fully support it.\n```\n\nI found a test tool function among this repo's unit tests, that is pretty close to the mixed content\nuse case in our server. So I tweaked it to create a repro case for you:\n\n```diff\ndiff --git a/tests/server/fastmcp/test_server.py b/tests/server/fastmcp/test_server.py\nindex c30930f..20c25af 100644\n--- a/tests/server/fastmcp/test_server.py\n+++ b/tests/server/fastmcp/test_server.py\n@@ -194,12 +194,12 @@ def image_tool_fn(path: str) -> Image:\n     return Image(path)\n \n \n-def mixed_content_tool_fn() -> list[ContentBlock]:\n-    return [\n-        TextContent(type=\"text\", text=\"Hello\"),\n-        ImageContent(type=\"image\", data=\"abc\", mimeType=\"image/png\"),\n+def mixed_content_tool_fn() -> tuple[str, Image, AudioContent]:\n+    return (\n+        \"Hello\",\n+        Image(data=b\"abc\", format=\"png\"),\n         AudioContent(type=\"audio\", data=\"def\", mimeType=\"audio/wav\"),\n-    ]\n+    )\n \n \n class TestServerTools:\n@@ -311,7 +311,7 @@ class TestServerTools:\n             assert content1.text == \"Hello\"\n             assert isinstance(content2, ImageContent)\n             assert content2.mimeType == \"image/png\"\n-            assert content2.data == \"abc\"\n+            assert content2.data == \"YWJj\"\n             assert isinstance(content3, AudioContent)\n             assert content3.mimeType == \"audio/wav\"\n             assert content3.data == \"def\"\n```\n\n`test_tool_mixed_content` fails with `PydanticSchemaGenerationError` on 1.10.1 but succeeds on 1.9.4.\n\n### Python & MCP Python SDK\n\n```Text\nPython 3.12, mcp 1.10.1\n```","author":{"url":"https://github.com/paxan","@type":"Person","name":"paxan"},"datePublished":"2025-06-30T18:40:50Z","url":"https://github.com/modelcontextprotocol/python-sdk/issues/1060"}

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:3143ecf5-73cf-f077-e8da-845d695aad1f
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idE332:23AE4E:205E9CD:2ADD30F:6B0575C3
html-safe-noncebece560bd44de12a2868bfff3724fbc2ec8d4cac6026cd070b287ba61fd1047b
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMzMyOjIzQUU0RToyMDVFOUNEOjJBREQzMEY6NkIwNTc1QzMiLCJ2aXNpdG9yX2lkIjoiNzM5OTk2MTk5NTQ2Mzk4MDQ4NCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac5ff3d26efb05f7d55373fef07ad81e54d54cbbfd09b11b0f9e2a41080dc2db53
hovercard-subject-tagissue:3189494707
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/1060/issue_layout
twitter:imagehttps://opengraph.githubassets.com/9ec044cee282361942129aafea2ccca89462281014b494b86792c4ff966cc4c3/modelcontextprotocol/python-sdk/issues/1060
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/9ec044cee282361942129aafea2ccca89462281014b494b86792c4ff966cc4c3/modelcontextprotocol/python-sdk/issues/1060
og:image:altInitial Checks I confirm that I'm using the latest version of MCP Python SDK I confirm that I searched for my issue in https://github.com/modelcontextprotocol/python-sdk/issues before opening this ...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamepaxan
hostnamegithub.com
expected-hostnamegithub.com
None507b2d62524c0f595c35a2a2ee8a6ec54b119f245b3c59eaa070013b70ed1ada
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
releasee7a883ae3b439b8952652eaa7803e2587f30e339
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/modelcontextprotocol/python-sdk/issues/1060#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmodelcontextprotocol%2Fpython-sdk%2Fissues%2F1060
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%2F1060
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/1060
Reloadhttps://github.com/modelcontextprotocol/python-sdk/issues/1060
Reloadhttps://github.com/modelcontextprotocol/python-sdk/issues/1060
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/1060
New issuehttps://github.com/login?return_to=https://github.com/modelcontextprotocol/python-sdk/issues/1060
PydanticSchemaGenerationError: Unable to generate pydantic-core schema for Image typehttps://github.com/modelcontextprotocol/python-sdk/issues/1060#top
P2https://github.com/modelcontextprotocol/python-sdk/issues?q=state%3Aopen%20label%3A%22P2%22
bughttps://github.com/modelcontextprotocol/python-sdk/issues?q=state%3Aopen%20label%3A%22bug%22
ready for workhttps://github.com/modelcontextprotocol/python-sdk/issues?q=state%3Aopen%20label%3A%22ready%20for%20work%22
https://github.com/paxan
paxanhttps://github.com/paxan
on Jun 30, 2025https://github.com/modelcontextprotocol/python-sdk/issues/1060#issue-3189494707
https://github.com/modelcontextprotocol/python-sdk/issueshttps://github.com/modelcontextprotocol/python-sdk/issues
https://github.com/paxan
paxanhttps://github.com/paxan
on Jun 30, 2025https://github.com/modelcontextprotocol/python-sdk/issues/1060#issuecomment-3020464915
6f43d1fhttps://github.com/modelcontextprotocol/python-sdk/commit/6f43d1f17022d9d45b51955304e39ad43ca48014
https://github.com/Kludex
Kludexhttps://github.com/Kludex
on Aug 9, 2025https://github.com/modelcontextprotocol/python-sdk/issues/1060#issuecomment-3171893823
Kludexhttps://github.com/Kludex
on Aug 9, 2025https://github.com/modelcontextprotocol/python-sdk/issues/1060#event-19068478962
Kludexhttps://github.com/Kludex
needs confirmationhttps://github.com/modelcontextprotocol/python-sdk/issues?q=state%3Aopen%20label%3A%22needs%20confirmation%22
on Aug 9, 2025https://github.com/modelcontextprotocol/python-sdk/issues/1060#event-19068479372
https://github.com/paxan
paxanhttps://github.com/paxan
on Aug 10, 2025https://github.com/modelcontextprotocol/python-sdk/issues/1060#issuecomment-3172693017
felixweinbergerhttps://github.com/felixweinberger
Kludexhttps://github.com/Kludex
on Oct 3, 2025https://github.com/modelcontextprotocol/python-sdk/issues/1060#event-20084078129
felixweinbergerhttps://github.com/felixweinberger
bughttps://github.com/modelcontextprotocol/python-sdk/issues?q=state%3Aopen%20label%3A%22bug%22
ready for workhttps://github.com/modelcontextprotocol/python-sdk/issues?q=state%3Aopen%20label%3A%22ready%20for%20work%22
P2https://github.com/modelcontextprotocol/python-sdk/issues?q=state%3Aopen%20label%3A%22P2%22
needs confirmationhttps://github.com/modelcontextprotocol/python-sdk/issues?q=state%3Aopen%20label%3A%22needs%20confirmation%22
on Oct 6, 2025https://github.com/modelcontextprotocol/python-sdk/issues/1060#event-20119063932
https://github.com/opensource-joe
opensource-joehttps://github.com/opensource-joe
on Aug 15, 2026https://github.com/modelcontextprotocol/python-sdk/issues/1060#issuecomment-5300003788
https://github.com/Dhananjay-alt
Dhananjay-althttps://github.com/Dhananjay-alt
on Nov 21, 2026https://github.com/modelcontextprotocol/python-sdk/issues/1060#issuecomment-7069134133
MCPServer: content-block returns are unstructured, prompt messages take Image/Audio #3320https://github.com/modelcontextprotocol/python-sdk/pull/3320
Replace RootModel wrappers with type aliases and TypeAdapter validation #3470https://github.com/modelcontextprotocol/python-sdk/pull/3470
@paxanhttps://github.com/paxan
Sign up for freehttps://github.com/signup?return_to=https://github.com/modelcontextprotocol/python-sdk/issues/1060
Sign in to commenthttps://github.com/login?return_to=https://github.com/modelcontextprotocol/python-sdk/issues/1060
P2https://github.com/modelcontextprotocol/python-sdk/issues?q=state%3Aopen%20label%3A%22P2%22
bughttps://github.com/modelcontextprotocol/python-sdk/issues?q=state%3Aopen%20label%3A%22bug%22
ready for workhttps://github.com/modelcontextprotocol/python-sdk/issues?q=state%3Aopen%20label%3A%22ready%20for%20work%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.