-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Description
OpenCode currently ignores MCP tool outputs with type: "resource". This prevents agents from receiving data from tools that return embedded resources, such as the get_file_contents tool in the official github-mcp-server.
When using get_file_contents, the agent receives only the status message (e.g., "successfully downloaded...") but the actual file content—returned as a resource item—is discarded.
To fix, update the MCP tool execution logic to handle resource content items so that:
- Text resources are passed to the agent as visible output.
- Binary/Blob resources are attached as files.
This will restore functionality for standard MCP servers that rely on embedded resources for content delivery.
This is a known pattern in the GitHub MCP server implementation (see github/github-mcp-server#607).
Plugins
None
OpenCode version
1.1.13
Steps to reproduce
- Configure the
github-mcp-serverin opencode. It's enough to enable therepostoolset and read-only mode, with a readonly PAT. - Ask the agent to read a file from a GitHub repository (e.g., "Read CONTRIBUTING.md from anomalyco/opencode").
- The agent will report success or confusion, as it receives the tool output
[{"type": "text", "text": "successfully downloaded..."}, {"type": "resource", "resource": {...}}]. - Export the session to confirm the file content is not there.
Screenshot and/or share link
No response
Operating System
No response
Terminal
No response
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working