Skip to content

Conversation

@antigremlin
Copy link
Contributor

What does this PR do?

This PR adds support for resource content types in MCP tool outputs. Previously, OpenCode ignored these, causing tools like github-mcp-server's get_file_contents to return empty results to the agent.

  • Updated MCP.tools() in packages/opencode/src/session/prompt.ts to process contentItem.type === "resource".
  • Text resources are now appended to the tool output.
  • Blob resources are attached as file parts.

Closes #7878

How did you verify your code works?

  • Verified with github-mcp-server by reading a file from a repository. The agent now correctly receives the file content.
  • Ran bun typecheck.

@github-actions
Copy link
Contributor

The following comment was made by an LLM, it may be inaccurate:

No duplicate PRs found

@rekram1-node rekram1-node merged commit 8b9a85b into anomalyco:dev Jan 12, 2026
2 checks passed
zerone0x pushed a commit to zerone0x/opencode that referenced this pull request Jan 12, 2026
zerone0x pushed a commit to zerone0x/opencode that referenced this pull request Jan 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.

Resource content type in MCP tool output is not supported

2 participants