René's URL Explorer Experiment


Title: feat(mcp): let agent tools return MCP content blocks by erkamyaman · Pull Request #451 · devframes/devframe · GitHub

Open Graph Title: feat(mcp): let agent tools return MCP content blocks by erkamyaman · Pull Request #451 · devframes/devframe

X Title: feat(mcp): let agent tools return MCP content blocks by erkamyaman · Pull Request #451 · devframes/devframe

Description: Problem The MCP adapter sends every tool result as one text block that holds the result as JSON. A tool cannot send other MCP content. For example, a screenshot tool cannot send the image as an image block, so the coding agent gets a long base64 string inside JSON text and cannot see the picture. Pangular Inspector, an Angular devtools built on devframe, has a component screenshot tool. It patches the built dist of @devframes/agentic so that the tool can send an image block next to its text. Change New withMcpContent(value, blocks) in devframe. It attaches MCP content blocks to a tool result and returns the same value. The blocks are stored under a non-enumerable Symbol.for('devframe:mcp-content') key. The value itself does not change: the RPC transport to the SPA, returns validation, and structuredContent all see the plain value, without the (often large) image data. New McpContentBlock type: text, image or audio. It is in devframe/types and does not use MCP SDK types. In tools/call, the MCP adapter sends the attached blocks in place of the JSON text block. It copies only the known fields of each block. If the tool has an output schema, structuredContent is still the plain result. An image result does not break a tool with an output schema. This is the same kind of problem as #400: if the adapter sent only the blocks, the SDK client would throw Tool ... has an output schema but did not return structured content. Invalid blocks (an empty array, a missing mimeType, an unknown type) make the call return an isError result with the new coded diagnostic DF0081. The adapter does not send them to the MCP client. Docs: a new "Returning images and other content" section in the Agent-Native guide, and the DF0081 error page. import { defineRpcFunction, withMcpContent } from 'devframe' export const captureComponent = defineRpcFunction({ name: 'my-plugin:capture-component', type: 'query', agent: { description: 'Take a screenshot of one component.' }, handler: async () => { const { markdown, png } = await capture() return withMcpContent({ markdown }, [ { type: 'text', text: markdown }, { type: 'image', data: png, mimeType: 'image/png' }, ]) }, }) Tests packages/agentic/src/mcp/__tests__/mcp-http.test.ts: over the HTTP route and the 2026-07-28 revision, the client gets the text block and the image block. packages/agentic/src/mcp/__tests__/mcp-server.test.ts: A registered tool sends text, image and audio blocks, and no structuredContent. An RPC-backed tool with an output schema sends the image block, and structuredContent is the plain value. Invalid blocks give an isError result with DF0081. packages/devframe/src/agent/__tests__/mcp-content.test.ts: withMcpContent does not change the value. JSON.stringify and structuredClone do not copy the blocks. With the adapter change reverted, the four adapter tests fail: the client gets one JSON text block and no image. Verified pnpm lint && pnpm knip && pnpm test && pnpm typecheck && pnpm build pass. The API snapshots show only the new withMcpContent, McpContentBlock, getMcpContent (internal) and DF0081.

Open Graph Description: Problem The MCP adapter sends every tool result as one text block that holds the result as JSON. A tool cannot send other MCP content. For example, a screenshot tool cannot send the image as an ima...

X Description: Problem The MCP adapter sends every tool result as one text block that holds the result as JSON. A tool cannot send other MCP content. For example, a screenshot tool cannot send the image as an ima...

Opengraph URL: https://github.com/devframes/devframe/pull/451

X: @github

direct link

Domain: github.com

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:e52928b1-e2a1-c36e-aaad-e8ae17af2c76
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idE85E:EA1A8:13113B2:1A17C7E:6AFB72E8
html-safe-nonce52749ec24a62348c108b054f82dabb56cb2bfa580477aca33a6328ee412304d8
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFODVFOkVBMUE4OjEzMTEzQjI6MUExN0M3RTo2QUZCNzJFOCIsInZpc2l0b3JfaWQiOiIxOTQxMzc2Mjg2NzQ4MDEzMjg4IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac3daa05f4f4670aae5048a7b3186156b521971929cfad4ac574d0b38584d64006
hovercard-subject-tagpull_request:4869535274
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/devframes/devframe/pull/451/files
twitter:imagehttps://avatars.githubusercontent.com/u/88717125?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/88717125?s=400&v=4
og:image:altProblem The MCP adapter sends every tool result as one text block that holds the result as JSON. A tool cannot send other MCP content. For example, a screenshot tool cannot send the image as an ima...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None0e29e7974fdda2feeaf5c891efd4b23b0734b23480232b62c7bdef13f40b5b48
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/devframes/devframe git https://github.com/devframes/devframe.git
octolytics-dimension-user_id279879373
octolytics-dimension-user_logindevframes
octolytics-dimension-repository_id1231722386
octolytics-dimension-repository_nwodevframes/devframe
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id1231722386
octolytics-dimension-repository_network_root_nwodevframes/devframe
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release2e8872b770cc4d5d0cc1f2026afab747a268e2ce
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/devframes/devframe/pull/451/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fdevframes%2Fdevframe%2Fpull%2F451%2Ffiles
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%2Fdevframes%2Fdevframe%2Fpull%2F451%2Ffiles
Sign uphttps://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=devframes%2Fdevframe
Reloadhttps://github.com/devframes/devframe/pull/451/files
Reloadhttps://github.com/devframes/devframe/pull/451/files
Reloadhttps://github.com/devframes/devframe/pull/451/files
devframeshttps://github.com/devframes
devframehttps://github.com/devframes/devframe
Codehttps://github.com/devframes/devframe
Issues12 (12)https://github.com/devframes/devframe/issues
Pull requests13 (13)https://github.com/devframes/devframe/pulls
Actionshttps://github.com/devframes/devframe/actions
Security and qualityhttps://github.com/devframes/devframe/security
Insightshttps://github.com/devframes/devframe/pulse
Sign up for GitHub https://github.com/signup?return_to=%2Fdevframes%2Fdevframe%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fdevframes%2Fdevframe%2Fissues%2Fnew%2Fchoose
antfuhttps://github.com/antfu
devframes:mainhttps://github.com/devframes/devframe/tree/main
erkamyaman:feat/mcp-tool-contenthttps://github.com/erkamyaman/devframe/tree/feat/mcp-tool-content
Conversation 5 https://github.com/devframes/devframe/pull/451
Commits 2 https://github.com/devframes/devframe/pull/451/commits
Checks 12 https://github.com/devframes/devframe/pull/451/checks
Files changed https://github.com/devframes/devframe/pull/451/files
Please reload this pagehttps://github.com/devframes/devframe/pull/451/files
feat(mcp): let agent tools return MCP content blocks https://github.com/devframes/devframe/pull/451/files#top
Show all changes 2 commits https://github.com/devframes/devframe/pull/451/files
4d326c3 feat(mcp): let agent tools return MCP content blocks erkamyaman Oct 14, 2026 https://github.com/devframes/devframe/pull/451/commits/4d326c3bb7c0abecaa25c52d6eb194a2596e29ad
7221f04 fix(mcp): check the holes of a sparse content block array erkamyaman Oct 15, 2026 https://github.com/devframes/devframe/pull/451/commits/7221f04bc83aa7982ba8d6535fe37ed885af1a1a
Clear filters https://github.com/devframes/devframe/pull/451/files
Please reload this pagehttps://github.com/devframes/devframe/pull/451/files
Please reload this pagehttps://github.com/devframes/devframe/pull/451/files
15.agent-native.md https://github.com/devframes/devframe/pull/451/files#diff-256cfb005765d3bb9564fe00fb2221c0453f7f4c809809eac90cd691096cc40b
DF0081.md https://github.com/devframes/devframe/pull/451/files#diff-910fe8942ab4c5427156b3bc0f6ec16940bb35e0bf901ebf3fc7b099ea5426a3
index.md https://github.com/devframes/devframe/pull/451/files#diff-98be74a69c00df291caec3fa9122f7b7afc74b917b7ea8714472bdd2b7fd23f8
mcp-http.test.ts https://github.com/devframes/devframe/pull/451/files#diff-c608d44d08e96b055f973d8eccce399e4229a7029c428400fa73f767d09c5781
mcp-server.test.ts https://github.com/devframes/devframe/pull/451/files#diff-7ac7e9a9bae251339ab373422092dc488f6e7ffb379dd4cadc02069b36025f46
build-server.ts https://github.com/devframes/devframe/pull/451/files#diff-54466ac21a0dd3beacb5a3fca42cdd0499fac1aeabf34c5e16382d96881215db
mcp-content.test.ts https://github.com/devframes/devframe/pull/451/files#diff-1421d741cf915492959a87c698e6e37f6b06d88363bef8cc8a2b73e0120f17a8
mcp-content.ts https://github.com/devframes/devframe/pull/451/files#diff-0edae3b754952b8c8047adf16519f11a92d6bde841c004b4ac46537d1ee654d5
index.ts https://github.com/devframes/devframe/pull/451/files#diff-fc4269142e01b9e4d85039427f5861e485b765c919b24db3730f40b71895708b
index.ts https://github.com/devframes/devframe/pull/451/files#diff-72dbffb2b642032c03600440619d44cbe1c09da87b2f0f3fcde6f0f68969560e
diagnostics.ts https://github.com/devframes/devframe/pull/451/files#diff-509316a0571ce8effd61922fd33d28e974c8cb509b3d59a3fdb15a5ee20bdc3f
mcp.ts https://github.com/devframes/devframe/pull/451/files#diff-f7efa41fc8522b5175dcfc82f1b794d55f8b8d7c51d4e571eda478e1c355b752
index.snapshot.d.ts https://github.com/devframes/devframe/pull/451/files#diff-e36c6d402239a03e9a6e3a7c285d18780f3584e9dd275c7e5220a6fc41fb160d
index.snapshot.js https://github.com/devframes/devframe/pull/451/files#diff-5cef874ad24f57dd53a5c8851226f9dbbd64ec3118f0f2efde4a5dc5ed33c772
internal.snapshot.d.ts https://github.com/devframes/devframe/pull/451/files#diff-cf90d6f74b3f49997e90ee080ce227993bfabf8fadfa4f1d20f7644c507b10d0
internal.snapshot.js https://github.com/devframes/devframe/pull/451/files#diff-8a4cb2424cc69992ffad201b9ba00373e932f4a1a17138220fff449eb9108dc3
types.snapshot.d.ts https://github.com/devframes/devframe/pull/451/files#diff-c53339d04f6316f1476d6844f94bc701efbac1c0e63dd7200d31a385ff9a3ad9
docs/content/1.guide/15.agent-native.mdhttps://github.com/devframes/devframe/pull/451/files#diff-256cfb005765d3bb9564fe00fb2221c0453f7f4c809809eac90cd691096cc40b
View file https://github.com/erkamyaman/devframe/blob/7221f04bc83aa7982ba8d6535fe37ed885af1a1a/docs/content/1.guide/15.agent-native.md
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/devframes/devframe/pull/451/{{ revealButtonHref }}
https://github.com/devframes/devframe/pull/451/files#diff-256cfb005765d3bb9564fe00fb2221c0453f7f4c809809eac90cd691096cc40b
https://github.com/devframes/devframe/pull/451/files#diff-256cfb005765d3bb9564fe00fb2221c0453f7f4c809809eac90cd691096cc40b
docs/content/6.errors/DF0081.mdhttps://github.com/devframes/devframe/pull/451/files#diff-910fe8942ab4c5427156b3bc0f6ec16940bb35e0bf901ebf3fc7b099ea5426a3
View file https://github.com/erkamyaman/devframe/blob/7221f04bc83aa7982ba8d6535fe37ed885af1a1a/docs/content/6.errors/DF0081.md
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/devframes/devframe/pull/451/{{ revealButtonHref }}
docs/content/6.errors/index.mdhttps://github.com/devframes/devframe/pull/451/files#diff-98be74a69c00df291caec3fa9122f7b7afc74b917b7ea8714472bdd2b7fd23f8
View file https://github.com/erkamyaman/devframe/blob/7221f04bc83aa7982ba8d6535fe37ed885af1a1a/docs/content/6.errors/index.md
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/devframes/devframe/pull/451/{{ revealButtonHref }}
https://github.com/devframes/devframe/pull/451/files#diff-98be74a69c00df291caec3fa9122f7b7afc74b917b7ea8714472bdd2b7fd23f8
https://github.com/devframes/devframe/pull/451/files#diff-98be74a69c00df291caec3fa9122f7b7afc74b917b7ea8714472bdd2b7fd23f8
packages/agentic/src/mcp/__tests__/mcp-http.test.tshttps://github.com/devframes/devframe/pull/451/files#diff-c608d44d08e96b055f973d8eccce399e4229a7029c428400fa73f767d09c5781
View file https://github.com/erkamyaman/devframe/blob/7221f04bc83aa7982ba8d6535fe37ed885af1a1a/packages/agentic/src/mcp/__tests__/mcp-http.test.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/devframes/devframe/pull/451/{{ revealButtonHref }}
https://github.com/devframes/devframe/pull/451/files#diff-c608d44d08e96b055f973d8eccce399e4229a7029c428400fa73f767d09c5781
https://github.com/devframes/devframe/pull/451/files#diff-c608d44d08e96b055f973d8eccce399e4229a7029c428400fa73f767d09c5781
https://github.com/devframes/devframe/pull/451/files#diff-c608d44d08e96b055f973d8eccce399e4229a7029c428400fa73f767d09c5781
packages/agentic/src/mcp/__tests__/mcp-server.test.tshttps://github.com/devframes/devframe/pull/451/files#diff-7ac7e9a9bae251339ab373422092dc488f6e7ffb379dd4cadc02069b36025f46
View file https://github.com/erkamyaman/devframe/blob/7221f04bc83aa7982ba8d6535fe37ed885af1a1a/packages/agentic/src/mcp/__tests__/mcp-server.test.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/devframes/devframe/pull/451/{{ revealButtonHref }}
https://github.com/devframes/devframe/pull/451/files#diff-7ac7e9a9bae251339ab373422092dc488f6e7ffb379dd4cadc02069b36025f46
https://github.com/devframes/devframe/pull/451/files#diff-7ac7e9a9bae251339ab373422092dc488f6e7ffb379dd4cadc02069b36025f46
https://github.com/devframes/devframe/pull/451/files#diff-7ac7e9a9bae251339ab373422092dc488f6e7ffb379dd4cadc02069b36025f46
packages/agentic/src/mcp/build-server.tshttps://github.com/devframes/devframe/pull/451/files#diff-54466ac21a0dd3beacb5a3fca42cdd0499fac1aeabf34c5e16382d96881215db
View file https://github.com/erkamyaman/devframe/blob/7221f04bc83aa7982ba8d6535fe37ed885af1a1a/packages/agentic/src/mcp/build-server.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/devframes/devframe/pull/451/{{ revealButtonHref }}
https://github.com/devframes/devframe/pull/451/files#diff-54466ac21a0dd3beacb5a3fca42cdd0499fac1aeabf34c5e16382d96881215db
https://github.com/devframes/devframe/pull/451/files#diff-54466ac21a0dd3beacb5a3fca42cdd0499fac1aeabf34c5e16382d96881215db
https://github.com/devframes/devframe/pull/451/files#diff-54466ac21a0dd3beacb5a3fca42cdd0499fac1aeabf34c5e16382d96881215db
https://github.com/devframes/devframe/pull/451/files#diff-54466ac21a0dd3beacb5a3fca42cdd0499fac1aeabf34c5e16382d96881215db
https://github.com/devframes/devframe/pull/451/files#diff-54466ac21a0dd3beacb5a3fca42cdd0499fac1aeabf34c5e16382d96881215db
packages/devframe/src/agent/__tests__/mcp-content.test.tshttps://github.com/devframes/devframe/pull/451/files#diff-1421d741cf915492959a87c698e6e37f6b06d88363bef8cc8a2b73e0120f17a8
View file https://github.com/erkamyaman/devframe/blob/7221f04bc83aa7982ba8d6535fe37ed885af1a1a/packages/devframe/src/agent/__tests__/mcp-content.test.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/devframes/devframe/pull/451/{{ revealButtonHref }}
packages/devframe/src/agent/mcp-content.tshttps://github.com/devframes/devframe/pull/451/files#diff-0edae3b754952b8c8047adf16519f11a92d6bde841c004b4ac46537d1ee654d5
View file https://github.com/erkamyaman/devframe/blob/7221f04bc83aa7982ba8d6535fe37ed885af1a1a/packages/devframe/src/agent/mcp-content.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/devframes/devframe/pull/451/{{ revealButtonHref }}
packages/devframe/src/index.tshttps://github.com/devframes/devframe/pull/451/files#diff-fc4269142e01b9e4d85039427f5861e485b765c919b24db3730f40b71895708b
View file https://github.com/erkamyaman/devframe/blob/7221f04bc83aa7982ba8d6535fe37ed885af1a1a/packages/devframe/src/index.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/devframes/devframe/pull/451/{{ revealButtonHref }}
https://github.com/devframes/devframe/pull/451/files#diff-fc4269142e01b9e4d85039427f5861e485b765c919b24db3730f40b71895708b
Please reload this pagehttps://github.com/devframes/devframe/pull/451/files
Please reload this pagehttps://github.com/devframes/devframe/pull/451/files
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

Viewport: width=device-width


URLs of crawlers that visited me.