Skip to content

feat(opencode): support MCP resource content#31940

Open
rekram1-node wants to merge 10 commits into
devfrom
mcp-resource-content
Open

feat(opencode): support MCP resource content#31940
rekram1-node wants to merge 10 commits into
devfrom
mcp-resource-content

Conversation

@rekram1-node

@rekram1-node rekram1-node commented Jun 11, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • resolve MCP resource mentions without forwarding custom resource URIs as provider-downloadable files
  • deliver supported image blobs as native image attachments and describe other binary resources by MIME type and size
  • add model-callable list_mcp_resources and read_mcp_resource tools
  • share resource content conversion between user-selected resources and model-called reads

Behavior

resources/read text is injected as text. Supported image blobs are converted from the returned base64 bytes into data-backed image parts. Other blobs remain visible as neutral binary resource descriptions. The original MCP URI is retained only as resource provenance.

The new tools let models discover concrete resources across connected MCP servers and read a resource by server name and URI.

Validation

  • bun test test/mcp/content.test.ts test/tool/mcp-resource.test.ts test/tool/registry.test.ts test/session/message-v2.test.ts
  • manually verified the local image/png MCP fixture becomes an image attachment containing the exact 14,396 returned bytes

No broad typecheck was run.

@rekram1-node rekram1-node changed the title fix(opencode): resolve MCP resource content fix(opencode): avoid downloading MCP resource URIs Jun 12, 2026
@rekram1-node rekram1-node changed the title fix(opencode): avoid downloading MCP resource URIs feat(opencode): support MCP resource content Jun 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant