feat: mcp resources
Closes #806
This adds the ability to add MCP resources in the opencode prompt. It works just like files, when you do @ it shows you the list of resources and you can select them...the resource is only fetched once the prompt is actually sent.
Here's an example of the behaviour.
https://github.com/user-attachments/assets/1fc9008e-bed1-4256-9bf9-3b17db597db7
I had to create a new endpoint on the server (as we couldn't re-use one like with Command in prompts).
@paoloricciuti @rekram1-node , tested this works great so far. this and prompts completes the loop on mcp servers.
Uhm, just realized there might be a problem in case an MCP server exposes a resource as file: or data:...unusual but better be safe than sorry...let me change that
Done! 😄
im gonna make a generic experimental endpoint so plugins can do this kinda thing too, and then merge those changes into here and integrate it
im gonna make a generic experimental endpoint so plugins can do this kinda thing too, and then merge those changes into here and integrate it
Uh that's interesting and very cool! Let me know if I can do something.
/review
lgtm