anomalyco / anomalyco/opencode
MCP resource @ mention treats a custom URI as a local file path and hangs on Windows
@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
-
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 -
Start OpenCode.
-
Type
@in the prompt. -
Select the MCP resource from the autocomplete picker.
-
Observe that OpenCode attempts to read the resource as a local file.
-
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, soresources/listsucceeds. - 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
-
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 -
Start OpenCode.
-
Type
@in the prompt. -
Select the MCP resource from the autocomplete picker.
-
Observe that OpenCode attempts to read the resource as a local file.
-
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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.