Skip to content

Bug: MCP resource @mention dispatches local file read instead of resources/read RPC #17543

Closed

Description

@audibleblink

Description

Steps to reproduce:

  1. Configure an MCP server that exposes resources (e.g. resource://promptd/git-status.sh)
  2. In an opencode session, type @git-status.sh — the resource autocompletes correctly
  3. Send the message

Expected behavior:
opencode sends a resources/read request to the MCP server with uri: "resource://promptd/git-status.sh". The server handles it and returns the content.

Actual behavior:
opencode constructs a file:// URL using the resource filename resolved against the current working directory (e.g. file:///Users/blink/Code/promptd/git-status.sh) and attempts to read it with its local file read tool. The file doesn't exist at that path, so it fails:

→ Read git-status.sh
Error: File not found: /Users/blink/Code/promptd/git-status.sh

Plugins

none

OpenCode version

1.2.26

Steps to reproduce

  1. Configure an MCP server that exposes resources (e.g. resource://promptd/git-status.sh)
  2. In an opencode session, type @git-status.sh — the resource autocompletes correctly
  3. Send the message

Screenshot and/or share link

No response

Operating System

No response

Terminal

No response

Activity

  1. added
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on Mar 15, 2026
  2. bkosm commented on Apr 15, 2026

    @bkosm

    My problem is currently that it only consumes resources starting with http, https or data. I naively tried to switch to data, hoping it will read them like Cursor or Claude does, but it ends in the error:

    Failed to download data://a/b: Error: failed to fetch the data URL
    

    The server is implemented with https://github.com/modelcontextprotocol/go-sdk

  3. removed
    bugSomething isn't working
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on May 3, 2026
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