Skip to content

[FEATURE]: Support MCP Resources (resources/read) in addition to MCP Tools #15535

Closed

Description

@feiwhang

Feature hasn't been suggested before.

  • I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

What to add

OpenCode currently connects to MCP servers and exposes their tools (tools/call) to the AI, but does not implement the resources capability (resources/list, resources/read) defined in the MCP specification.

MCP servers can expose both tools and resources. Resources are identified by URIs and represent readable content — files, documents, or structured data that the AI can fetch on demand. Without resources/read support, the AI cannot access any of these, even when the MCP server explicitly serves them.

Concrete example

An MCP server exposes documentation as resources under a custom URI scheme. Each skill tool returns a summary, but the full reference material (e.g. API references, templates, scripts) lives in sub-resources like:

skill://my-skill/references/some-reference.md

In Cursor (which implements resources/read), the AI can fetch this URI directly through the MCP server. In OpenCode, it cannot — the only fallback is reading the file from the local filesystem, which breaks in remote or containerized environments where the files aren't mounted.

What to change

  1. During MCP server initialization, negotiate the resources capability alongside tools.
  2. Expose a mechanism for the AI to call resources/read with a URI, and return the resource contents (text or blob).
  3. Optionally: expose resources/list so the AI can discover available resources without needing to know URIs in advance.

Benefits

  • Full MCP spec compliance — resources are a first-class capability in MCP 2025-11-25; supporting them makes OpenCode a complete MCP client.
  • Richer context for AI — MCP servers often serve supplementary reference material (docs, templates, examples) via resources that tools alone cannot surface.
  • Environment-agnostic access — resource content comes from the MCP server itself, so it works in remote/containerized setups where the local filesystem isn't available.
  • Parity with other MCP clients — Cursor already supports this; the gap makes OpenCode a second-class citizen when working with resource-heavy MCP servers.

Activity

  1. added
    discussionUsed for feature requests, proposals, ideas, etc. Open discussion
    on Mar 1, 2026
  2. added
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on Mar 1, 2026
  3. github-actions commented on Mar 1, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

  4. visusnet commented on Mar 25, 2026

    @visusnet

    I filed almost the same request and closed it once GitHub told me that it had found this issue. I have already tested it locally and a working implementation can be found here: dev...visusnet:opencode:feat/mcp-resource-tools

    In case this feature is accepted, I'd be happy to create a PR.

  5. feiwhang commented on Mar 27, 2026

    @feiwhang
    Author

    Tested #15535 (comment) locally, @visusnet it works flawless for me.

    ⚙ xxx-skills-local_xxxx
    ⚙ mcp_list_resources [server=xxx-skills-local]
    ⚙ mcp_read_resource [server=xxx-skills-local, uri=skill://xxx/references/xxxx.md]
    
  6. dchasman commented on Apr 4, 2026

    @dchasman

    Adding another vote for this - one of our use cases is exactly the structured documentation in markdown format exposed as resources scenario! Thank you!

  7. feiwhang commented on Apr 4, 2026

    @feiwhang
    Author
  8. assigned and unassigned on Apr 26, 2026
  9. removed
    discussionUsed for feature requests, proposals, ideas, etc. Open discussion
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on May 3, 2026
  10. chrismo80 commented on May 21, 2026

    @chrismo80

    Just wanted to test resources in opencode and recognized, that the LLM cannot see them. =(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions