Skip to content

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

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

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