MCP Resources and Prompts #580

Closed
opened 2026-02-16 17:27:25 -05:00 by yindo · 29 comments
Owner

Originally created by @pattobrien on GitHub (Jul 9, 2025).

Originally assigned to: @thdxr on GitHub.

MCP Resources and Prompts are being implemented by various popular AI IDEs and CLI tools (e.g. VSCode Copilot, Claude Code, Claude Desktop). I would point to VSCode specifically as my personal favorite implementation of both MCP features.

Some notable use cases under this (rather large) feature umbrella could be:

  • allow Prompts to be triggered via slash-commands
  • allow Resources to be attached to context window via similar slash-commands (in VSCode it uses "@" prefix, rather than "/" for resources)
  • display all attached Resources as e.g. chip components in the chat UI, with the resource name/title
  • allow Tool results to add Resources to the context window

I'm quite familiar with the MCP spec, as well as its implementation in the major MCP clients, so let me know what other details you'd like - more than happy to help.

Originally created by @pattobrien on GitHub (Jul 9, 2025). Originally assigned to: @thdxr on GitHub. MCP Resources and Prompts are being implemented by various popular AI IDEs and CLI tools (e.g. VSCode Copilot, Claude Code, Claude Desktop). I would point to VSCode specifically as my personal favorite implementation of both MCP features. Some notable use cases under this (rather large) feature umbrella could be: - allow Prompts to be triggered via slash-commands - allow Resources to be attached to context window via similar slash-commands (in VSCode it uses "@" prefix, rather than "/" for resources) - display all attached Resources as e.g. chip components in the chat UI, with the resource name/title - allow Tool results to add Resources to the context window I'm quite familiar with the MCP spec, as well as its implementation in the major MCP clients, so let me know what other details you'd like - more than happy to help.
yindo closed this issue 2026-02-16 17:27:25 -05:00
Author
Owner

@mchzimm commented on GitHub (Jul 10, 2025):

i think the idea is great ❤️
however, how about agent-zero style, where we could have a "MCP creator" agent, with single- / multi-shot prompt, that could dynamically create local MCP servers? and for context, it should invoke a "web search agent" (configurable please, i run SearXNG docker / podman container, no apikey required) that searches for relevant info on how to implement an API or CLI tool call, and then pass the compiled context back to the MCP creator agent, which then writes the MCP config file and sends the tool definition to the parent agent.

@mchzimm commented on GitHub (Jul 10, 2025): i think the idea is great ❤️ however, how about agent-zero style, where we could have a "MCP creator" agent, with single- / multi-shot prompt, that could dynamically create local MCP servers? and for context, it should invoke a "web search agent" (configurable please, i run SearXNG docker / podman container, no apikey required) that searches for relevant info on how to implement an API or CLI tool call, and then pass the compiled context back to the MCP creator agent, which then writes the MCP config file and sends the tool definition to the parent agent.
Author
Owner

@JUVOJustin commented on GitHub (Jul 11, 2025):

I would also love this. Absolutely underrated Claude code feature imo is including MCP resources in rules. Syntax is simple, and it allows remote updating rules for companies or open source projects. Pretty neat!

Example we have in our rules:

## WordPress
- Use @wordpress-dev-docs:wordpress://rules/base as your wordpress base coding rule
- Use @wordpress-dev-docs:wordpress://rules/quality_assurance_phpstan as guideline when working with phpstan in wordpress context
- Use @wordpress-dev-docs:wordpress://rules/quries as guideline when creating wordpress queries

Doc Reference:
https://docs.anthropic.com/en/docs/claude-code/mcp#use-mcp-resources

@JUVOJustin commented on GitHub (Jul 11, 2025): I would also love this. Absolutely underrated Claude code feature imo is including MCP resources in rules. Syntax is simple, and it allows remote updating rules for companies or open source projects. Pretty neat! Example we have in our rules: ```md ## WordPress - Use @wordpress-dev-docs:wordpress://rules/base as your wordpress base coding rule - Use @wordpress-dev-docs:wordpress://rules/quality_assurance_phpstan as guideline when working with phpstan in wordpress context - Use @wordpress-dev-docs:wordpress://rules/quries as guideline when creating wordpress queries ``` Doc Reference: https://docs.anthropic.com/en/docs/claude-code/mcp#use-mcp-resources
Author
Owner

@VikashLoomba commented on GitHub (Jul 11, 2025):

+1 to this, would make opencode immensely more usable for folks whose dev workflows are often guided by custom prompts/commands

@VikashLoomba commented on GitHub (Jul 11, 2025): +1 to this, would make opencode immensely more usable for folks whose dev workflows are often guided by custom prompts/commands
Author
Owner

@HKiOnline commented on GitHub (Jul 22, 2025):

I'd love to have the support for prompts and resources. ❤️

I'd +1 the slash-command for prompts and at-sign for resource reference.

I'm making a MCP server for storing prompts and I have noticed that woefully few MCP client/host implementations support those capabilities. I'd be very happy if I could use my MCP server one day with Opencode. In any case it would definitely open new possibilities for Opencode as well.

@HKiOnline commented on GitHub (Jul 22, 2025): I'd love to have the support for prompts and resources. ❤️ I'd +1 the slash-command for prompts and at-sign for resource reference. I'm making a MCP server for storing prompts and I have noticed that woefully few MCP client/host implementations support those capabilities. I'd be very happy if I could use my MCP server one day with Opencode. In any case it would definitely open new possibilities for Opencode as well.
Author
Owner

@elementalvoid commented on GitHub (Aug 5, 2025):

Huge +1 here.

My team has created an internal MCP server that we're using to share resources, prompts, and tools for all our devs under a single, authenticated, HTTP endpoint. We don't want to commit "common prompts" into all our repositories. We don't want to make devs copy/paste large prompts from some Confluence page. Exposing them via an MCP has worked well.

@elementalvoid commented on GitHub (Aug 5, 2025): Huge +1 here. My team has created an internal MCP server that we're using to share resources, prompts, and tools for all our devs under a single, authenticated, HTTP endpoint. We don't want to commit "common prompts" into all our repositories. We don't want to make devs copy/paste large prompts from some Confluence page. Exposing them via an MCP has worked well.
Author
Owner

@smissingham commented on GitHub (Aug 7, 2025):

I have a personal mcp server just for the purpose of sharing prompts across different tools.

would be great if opencode could have those as slash commands the same way avante.nvim and other do

@smissingham commented on GitHub (Aug 7, 2025): I have a personal mcp server just for the purpose of sharing prompts across different tools. would be great if opencode could have those as slash commands the same way avante.nvim and other do
Author
Owner

@vfarcic commented on GitHub (Aug 9, 2025):

+1

@vfarcic commented on GitHub (Aug 9, 2025): +1
Author
Owner

@nelspir commented on GitHub (Aug 14, 2025):

+1

@nelspir commented on GitHub (Aug 14, 2025): +1
Author
Owner

@rekram1-node commented on GitHub (Aug 14, 2025):

Slash commands should be coming sometime this week: https://x.com/thdxr/status/1955718582639251488

@rekram1-node commented on GitHub (Aug 14, 2025): Slash commands should be coming sometime this week: https://x.com/thdxr/status/1955718582639251488
Author
Owner

@smissingham commented on GitHub (Aug 23, 2025):

Slash commands look excellent, but sadly don't seem to work via MCP yet.

Great foundation though, shouldn't be too hard to have MCP prompts plugged into this feature

https://opencode.ai/docs/commands/

In the meantime, I'm symlinking my prompts collection all over the place 😅

@smissingham commented on GitHub (Aug 23, 2025): Slash commands look excellent, but sadly don't seem to work via MCP yet. Great foundation though, shouldn't be too hard to have MCP prompts plugged into this feature https://opencode.ai/docs/commands/ In the meantime, I'm symlinking my prompts collection all over the place 😅
Author
Owner

@adam-paterson commented on GitHub (Sep 17, 2025):

+1

@adam-paterson commented on GitHub (Sep 17, 2025): +1
Author
Owner

@john-persson-polestar commented on GitHub (Sep 18, 2025):

+1

@john-persson-polestar commented on GitHub (Sep 18, 2025): +1
Author
Owner

@nelspir commented on GitHub (Sep 19, 2025):

+1

@nelspir commented on GitHub (Sep 19, 2025): +1
Author
Owner

@rekram1-node commented on GitHub (Sep 19, 2025):

those who have recently reacted are those +1s specifically for mcp prompts?

@rekram1-node commented on GitHub (Sep 19, 2025): those who have recently reacted are those +1s specifically for mcp prompts?
Author
Owner

@adam-paterson commented on GitHub (Sep 20, 2025):

those who have recently reacted are those +1s specifically for mcp prompts?

Yeah, prompts for MeV

@adam-paterson commented on GitHub (Sep 20, 2025): > those who have recently reacted are those +1s specifically for mcp prompts? Yeah, prompts for MeV
Author
Owner

@john-persson-polestar commented on GitHub (Sep 21, 2025):

those who have recently reacted are those +1s specifically for mcp prompts?

Yes.
I recently added a prompt to my MCP server and I'm not even sure how I would call it from opencode without slash commands. I can see the prompt being available in the MCP inspector and as a slash command in Calude Code, but when I ask for it in opencode (Claude Sonnet 4) it can't find it:

opencode:

Image

Claude Code:

Image

MCP Inspector:

Image
@john-persson-polestar commented on GitHub (Sep 21, 2025): > those who have recently reacted are those +1s specifically for mcp prompts? Yes. I recently added a prompt to my MCP server and I'm not even sure how I would call it from opencode without slash commands. I can see the prompt being available in the [MCP inspector](https://modelcontextprotocol.io/docs/tools/inspector) and as a slash command in Calude Code, but when I ask for it in opencode (Claude Sonnet 4) it can't find it: **opencode:** <img width="1205" height="330" alt="Image" src="https://github.com/user-attachments/assets/0348b30e-31e4-47e9-9863-597dd455e979" /> **Claude Code:** <img width="1171" height="143" alt="Image" src="https://github.com/user-attachments/assets/5997c800-3c42-4695-82e8-fe62dfb85a11" /> **MCP Inspector:** <img width="1387" height="707" alt="Image" src="https://github.com/user-attachments/assets/e8814924-75ec-4577-b829-f89733e258f7" />
Author
Owner

@rekram1-node commented on GitHub (Sep 21, 2025):

I think this can be best addressed once vercel ai sdk adds support for this:
https://github.com/vercel/ai/issues/6294

@rekram1-node commented on GitHub (Sep 21, 2025): I think this can be best addressed once vercel ai sdk adds support for this: https://github.com/vercel/ai/issues/6294
Author
Owner

@VikashLoomba commented on GitHub (Sep 22, 2025):

@rekram1-node if I could push back here a little bit - it doesn't really make sense for the AI SDK to implement "prompt" support like you are suggesting. Prompts are generally exposed as slash commands or parameterized forms meant for the user to initiate and fill in, rather than something for the underlying LLM/AI to interact with. Using the mcp typescript SDK, the way that prompts should be exposed in OpenCode should be similar to how its done in Claude Code, where typing "/" makes a ListPromptsRequest for every connected MCP server and adds them to the dropdown of commands. Basically, the LLM isn't given a list of prompts like its given a list of tools - a user chooses and fills in a prompt template, which gets sent to the LLM.

@VikashLoomba commented on GitHub (Sep 22, 2025): @rekram1-node if I could push back here a little bit - it doesn't really make sense for the AI SDK to implement "prompt" support like you are suggesting. Prompts are generally exposed as slash commands or parameterized forms meant for the user to initiate and fill in, rather than something for the underlying LLM/AI to interact with. Using the mcp typescript SDK, the way that prompts should be exposed in OpenCode should be similar to how its done in Claude Code, where typing "/" makes a ListPromptsRequest for every connected MCP server and adds them to the dropdown of commands. Basically, the LLM isn't given a list of prompts like its given a list of tools - a user chooses and fills in a prompt template, which gets sent to the LLM.
Author
Owner

@rekram1-node commented on GitHub (Sep 22, 2025):

@VikashLoomba we are talking about mcp server supplied prompts, we use the experimental_createMCPClient from vercel ai sdk. I am not suggesting the prompts be given to the llm. But we use the mcp client from the vercel ai sdk which only returns tools rn it won't grab prompts

Agree on:

Prompts are generally exposed as slash commands or parameterized forms meant for the user to initiate and fill in, rather than something for the underlying LLM/AI to interact with

Maybe I wasn't being clear here but we are in agreement

@rekram1-node commented on GitHub (Sep 22, 2025): @VikashLoomba we are talking about mcp server supplied prompts, we use the experimental_createMCPClient from vercel ai sdk. I am not suggesting the prompts be given to the llm. But we use the mcp client from the vercel ai sdk which only returns tools rn it won't grab prompts Agree on: > Prompts are generally exposed as slash commands or parameterized forms meant for the user to initiate and fill in, rather than something for the underlying LLM/AI to interact with Maybe I wasn't being clear here but we are in agreement
Author
Owner

@VikashLoomba commented on GitHub (Sep 22, 2025):

@VikashLoomba we are talking about mcp server supplied prompts, we use the experimental_createMCPClient from vercel ai sdk. I am not suggesting the prompts be given to the llm. But we use the mcp client from the vercel ai sdk which only returns tools rn it won't grab prompts

Agree on:

Prompts are generally exposed as slash commands or parameterized forms meant for the user to initiate and fill in, rather than something for the underlying LLM/AI to interact with

Maybe I wasn't being clear here but we are in agreement

Got it, I probably should have been more clear in my response of what I was alluding to, which was that we could use the underlying transport that's passed to the experimental_createMCPClient to send a message to the server for listing the prompts instead of waiting for the AI SDK to expose prompts in their client implementation.

@VikashLoomba commented on GitHub (Sep 22, 2025): > [@VikashLoomba](https://github.com/VikashLoomba) we are talking about mcp server supplied prompts, we use the experimental_createMCPClient from vercel ai sdk. I am not suggesting the prompts be given to the llm. But we use the mcp client from the vercel ai sdk which only returns tools rn it won't grab prompts > > Agree on: > > > Prompts are generally exposed as slash commands or parameterized forms meant for the user to initiate and fill in, rather than something for the underlying LLM/AI to interact with > > Maybe I wasn't being clear here but we are in agreement Got it, I probably should have been more clear in my response of what I was alluding to, which was that we could use the underlying transport that's passed to the `experimental_createMCPClient` to send a message to the server for listing the prompts instead of waiting for the AI SDK to expose prompts in their client implementation.
Author
Owner

@rekram1-node commented on GitHub (Sep 22, 2025):

yeah true

@rekram1-node commented on GitHub (Sep 22, 2025): yeah true
Author
Owner

@kziemski commented on GitHub (Nov 19, 2025):

is there any chance we could expose the mcpclient so that plugin developers could pass a call to it?

@kziemski commented on GitHub (Nov 19, 2025): is there any chance we could expose the mcpclient so that plugin developers could pass a call to it?
Author
Owner

@rekram1-node commented on GitHub (Nov 19, 2025):

Yeah we can expose that

@rekram1-node commented on GitHub (Nov 19, 2025): Yeah we can expose that
Author
Owner

@kziemski commented on GitHub (Nov 20, 2025):

Thank you man if were able to interact with the client in the plugin it will provide an outlet for some of the mcp servers out there are utilizing more of the spec than just the tools.

@kziemski commented on GitHub (Nov 20, 2025): Thank you man if were able to interact with the client in the plugin it will provide an outlet for some of the mcp servers out there are utilizing more of the spec than just the tools.
Author
Owner

@luifr10 commented on GitHub (Nov 25, 2025):

I think this can be best addressed once vercel ai sdk adds support for this: vercel/ai#6294

It appears that the vercel ai sdk functionality has been implemented. Do you plan to make the mcp prompt and resource usable by opencode?

@luifr10 commented on GitHub (Nov 25, 2025): > I think this can be best addressed once vercel ai sdk adds support for this: [vercel/ai#6294](https://github.com/vercel/ai/issues/6294) It appears that the vercel ai sdk functionality has been implemented. Do you plan to make the mcp prompt and resource usable by opencode?
Author
Owner

@paoloricciuti commented on GitHub (Dec 12, 2025):

I have a PR ready to implement prompts in opencode...my implementation

  1. fetches the prompts when the MCP server connects
  2. add each prompt as a command like /mcp.servername.promptname
  3. fetches the prompt when the user actually sends it and does the replacement just like another command

I've tested it locally, and it works wonderfully (and I plan to open a PR for resources later on).

Can I just go ahead and open the PR?

@paoloricciuti commented on GitHub (Dec 12, 2025): I have a PR ready to implement prompts in `opencode`...my implementation 1. fetches the prompts when the MCP server connects 2. add each prompt as a command like `/mcp.servername.promptname` 3. fetches the prompt when the user actually sends it and does the replacement just like another command I've tested it locally, and it works wonderfully (and I plan to open a PR for resources later on). Can I just go ahead and open the PR?
Author
Owner

@kziemski commented on GitHub (Dec 12, 2025):

@paoloricciuti do you have the repo somewhere i was hopping to test something with prompts and resources?

@kziemski commented on GitHub (Dec 12, 2025): @paoloricciuti do you have the repo somewhere i was hopping to test something with prompts and resources?
Author
Owner

@paoloricciuti commented on GitHub (Dec 12, 2025):

@kziemski here's the branch on my fork...ready to open a PR whenever

https://github.com/paoloricciuti/opencode/tree/mcp-prompts

And this is how it looks like using it:

https://github.com/user-attachments/assets/e2cec744-1383-4de6-a86b-889b3186f32d

@paoloricciuti commented on GitHub (Dec 12, 2025): @kziemski here's the branch on my fork...ready to open a PR whenever https://github.com/paoloricciuti/opencode/tree/mcp-prompts And this is how it looks like using it: https://github.com/user-attachments/assets/e2cec744-1383-4de6-a86b-889b3186f32d
Author
Owner

@paoloricciuti commented on GitHub (Jan 1, 2026):

For anyone following this issue: prompts are now available in opencode through #5767 and #6542 will actually close this issue by implementing MCP resources 🤞🏻

@paoloricciuti commented on GitHub (Jan 1, 2026): For anyone following this issue: prompts are now available in `opencode` through #5767 and #6542 will actually close this issue by implementing MCP resources 🤞🏻
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#580