anomalyco / anomalyco/opencode

MCP resource @ mention treats a custom URI as a local file path and hangs on Windows

Open
#44,487 2 comments 0 reactions 1 assignee View on GitHub

@Hona is already working on this.

Since Aug 23, 2026.

Dominant language
TypeScript
Stars
209k
Forks
27.5k
PR merge metrics
PR metrics pending

Description

Description
Description

OpenCode correctly discovers non-file MCP resources and shows them in the @ autocomplete picker.

However, selecting a table resource with a custom URI causes OpenCode to treat the URI as a local filesystem path. The file read fails with ENOENT, and the UI remains stuck with a spinner.

The MCP resource itself is valid and can be successfully read through resources/read using its exact URI.

OpenCode version

1.18.21

Operating system

Windows 11

Example resource

Returned by resources/list:

{
  "uri": "jdbc-mcp://catalog/ssj/schemas/SSV/tables/TI_INCOMING_TYPE",
  "name": "SSV.TI_INCOMING_TYPE",
  "mimeType": "application/json"
}

Calling MCP resources/read with this exact URI returns the resource content successfully.

Steps to reproduce
  1. Configure an MCP server that exposes a resource using a custom URI scheme, for example:

    jdbc-mcp://catalog/ssj/schemas/SSV/tables/TI_INCOMING_TYPE

  2. Start OpenCode.

  3. Type @ in the prompt.

  4. Select the MCP resource from the autocomplete picker.

  5. Observe that OpenCode attempts to read the resource as a local file.

  6. The read fails with ENOENT, and the prompt remains stuck/spinning.

Expected behavior

OpenCode should call MCP resources/read with the exact URI returned by resources/list and attach the returned content to the prompt.

MCP resource URIs are opaque identifiers and are not necessarily filesystem paths.

Actual behavior

The custom MCP URI is passed to the filesystem-reading path. This produces an ENOENT error, and OpenCode does not recover from the failure.

Additional information
  • The resource is correctly displayed in the @ picker, so resources/list succeeds.
  • Reading the same resource directly through MCP succeeds.
  • A catalog manifest resource from the same MCP server can be attached successfully.
  • The failure occurs with the concrete table resource shown above.
  • The MCP server uses stdio transport.
  • The server reports both Resources and Resource Templates capabilities.

Relevant server initialization information:

Client: opencode 1.18.21
MCP protocol: 2025-11-25
Registered resources: 368
Registered resource templates: 2

If useful, I can provide the MCP server implementation and a complete protocol trace.

Plugins

None

OpenCode version

1.18.21

Steps to reproduce
  1. Configure an MCP server that exposes a resource using a custom URI scheme, for example:

    jdbc-mcp://catalog/ssj/schemas/SSV/tables/TI_INCOMING_TYPE

  2. Start OpenCode.

  3. Type @ in the prompt.

  4. Select the MCP resource from the autocomplete picker.

  5. Observe that OpenCode attempts to read the resource as a local file.

  6. The read fails with ENOENT, and the prompt remains stuck/spinning.

Screenshot and/or share link

No response

Operating System

Windows 11

Terminal

opencode desktop

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.