Skip to content

[FEATURE]: MCP resource support for LLM #19102

@visusnet

Description

@visusnet

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

OpenCode can connect to MCP servers and expose their tools to the LLM. #806 added MCP prompt support, but MCP resources are still not accessible to the LLM. Servers can expose resources (via URI) but the LLM has no way to discover or read them.

It would be useful if the LLM could list available resources/resource templates and read them by URI, similar to how MCP tools are already accessible.

One approach that I have successfully tested with minimal changes:

  • Add listResourceTemplates() support to the MCP client (src/mcp/index.ts)
  • Add two built-in tools: mcp_list_resources and mcp_read_resource
  • Document the new tools in tools.mdx and mcp-servers.mdx

#7510 seems related, however it asks for resource template support and I guess it is meant as a prompt feature rather than a mechanism the LLM can use.

I am happy to provide a PR if this feature request is accepted.

Metadata

Metadata

Assignees

Labels

coreAnything pertaining to core functionality of the application (opencode server stuff)discussionUsed for feature requests, proposals, ideas, etc. Open discussion

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions