Skip to content

fix(opencode): ignore MCP resource file downloads#28466

Open
Arcadi4 wants to merge 1 commit into
anomalyco:devfrom
Arcadi4:fix/mcp-resource-custom-scheme
Open

fix(opencode): ignore MCP resource file downloads#28466
Arcadi4 wants to merge 1 commit into
anomalyco:devfrom
Arcadi4:fix/mcp-resource-custom-scheme

Conversation

@Arcadi4
Copy link
Copy Markdown

@Arcadi4 Arcadi4 commented May 20, 2026

Issue for this PR

Closes #14753 #8920

Partial Fix #15535

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

MCP resource @mentions are resolved through resources/read, then stored as file parts with the original resource URI. For non-text/plain resources, model message conversion was forwarding that original custom URI to the AI SDK as a downloadable file, which caused schemes like status:// or simplifier:// to fail URL validation.

This keeps resolved MCP resource content in the prompt as text, but skips forwarding the original MCP resource file part to the model. The stored part remains available for history/UI, while the AI SDK no longer tries to download custom MCP schemes directly.

How did you verify your code works?

Ran the built artifact from the PR branch and verified that custom file URIs worked.

Screenshots / recordings

image

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@Arcadi4 Arcadi4 force-pushed the fix/mcp-resource-custom-scheme branch from 10aa249 to 36c7904 Compare May 20, 2026 11:22
Resolved the MCP resource @mention path so custom-scheme resources are still readable through resources/read, but their original URI is no longer forwarded to the model as a downloadable file attachment. That prevents the AI SDK from trying to fetch non-http schemes directly while preserving the resolved resource text in the prompt.
@Arcadi4 Arcadi4 force-pushed the fix/mcp-resource-custom-scheme branch from 36c7904 to 6e2b571 Compare May 20, 2026 11:29
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.

[FEATURE]: Support MCP Resources (resources/read) in addition to MCP Tools MCP Ressources with custom scheme

1 participant