[FEATURE]:model-invoked MCP resources #6504

Open
opened 2026-02-16 18:04:25 -05:00 by yindo · 1 comment
Owner

Originally created by @dan-kwiat on GitHub (Jan 16, 2026).

Originally assigned to: @thdxr on GitHub.

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

It's great to see MCP resources added (#6542). This means users can now pull resources from connected servers into context by tagging them with @ (human-invoked).

However, to get the most out of MCP resources, the model needs the ability to read resources itself (model-invoked). It's like the difference between a user attaching a couple of handpicked files to their prompt vs them connecting the model to a Skill directory and giving the model free rein to list and read files in that directory. Other agents including claude code already have model-invoked resources.

The implementation is simple, the LLM just needs two global tools: readMcpResource and listMcpResources. These trigger the corresponding methods already defined in https://github.com/anomalyco/opencode/blob/dev/packages/opencode/src/mcp/index.ts

In my experience this implementation alone leads to very good performance without additional system instruction. Ideally it should be user configurable whether or not the results of listMcpResources goes into the system instruction upfront or not.

The next stage would be to think about list changed notifications, subscriptions and resource templates, but the first steps above would go a long way to improving the developer experience without much investment.

Originally created by @dan-kwiat on GitHub (Jan 16, 2026). Originally assigned to: @thdxr on GitHub. ### Feature hasn't been suggested before. - [x] I have verified this feature I'm about to request hasn't been suggested before. ### Describe the enhancement you want to request It's great to see MCP resources added (#6542). This means users can now pull resources from connected servers into context by tagging them with @ (human-invoked). However, to get the most out of MCP resources, the model needs the ability to read resources itself (model-invoked). It's like the difference between a user attaching a couple of handpicked files to their prompt vs them connecting the model to a Skill directory and giving the model free rein to list and read files in that directory. Other agents including claude code already have model-invoked resources. The implementation is simple, the LLM just needs two global tools: `readMcpResource` and `listMcpResources`. These trigger the corresponding methods already defined in https://github.com/anomalyco/opencode/blob/dev/packages/opencode/src/mcp/index.ts In my experience this implementation alone leads to very good performance without additional system instruction. Ideally it should be user configurable whether or not the results of `listMcpResources` goes into the system instruction upfront or not. The next stage would be to think about list changed notifications, subscriptions and resource templates, but the first steps above would go a long way to improving the developer experience without much investment.
yindo added the discussion label 2026-02-16 18:04:25 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Jan 16, 2026):

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

  • #806: MCP Resources and Prompts (foundational feature request for MCP resources/prompts)
  • #6542: feat: mcp resources (implemented human-invoked MCP resources)
  • #7399: Filter which tools are loaded from MCP servers (complementary feature for tool filtering)
  • #7406: Support MCP-CLI for on-demand loading of MCP tools for reduced token consumption (related to on-demand tool loading)

This feature request specifically seeks model-invoked capabilities for MCP resources, which appears to be distinct from the human-invoked resources added in #6542. The proposed implementation would give the model automatic access to readMcpResource and listMcpResources tools to independently discover and retrieve resources, similar to how Claude Code and other agents handle model-invoked resources.

Feel free to ignore if you've already reviewed these related issues.

@github-actions[bot] commented on GitHub (Jan 16, 2026): This issue might be a duplicate of or related to existing issues. Please check: - #806: MCP Resources and Prompts (foundational feature request for MCP resources/prompts) - #6542: feat: mcp resources (implemented human-invoked MCP resources) - #7399: Filter which tools are loaded from MCP servers (complementary feature for tool filtering) - #7406: Support MCP-CLI for on-demand loading of MCP tools for reduced token consumption (related to on-demand tool loading) This feature request specifically seeks model-invoked capabilities for MCP resources, which appears to be distinct from the human-invoked resources added in #6542. The proposed implementation would give the model automatic access to `readMcpResource` and `listMcpResources` tools to independently discover and retrieve resources, similar to how Claude Code and other agents handle model-invoked resources. Feel free to ignore if you've already reviewed these related issues.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#6504