Skip to content

MCP Resources and Prompts #806

Closed

Description

@pattobrien

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.

Activity

  1. self-assigned this
    on Jul 10, 2025
  2. mchzimm commented on Jul 10, 2025

    @mchzimm

    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.

  3. JUVOJustin commented on Jul 11, 2025

    @JUVOJustin

    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

  4. VikashLoomba commented on Jul 11, 2025

    @VikashLoomba

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

  5. HKiOnline commented on Jul 22, 2025

    @HKiOnline

    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.

  6. elementalvoid commented on Aug 5, 2025

    @elementalvoid

    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.

  7. smissingham commented on Aug 8, 2025

    @smissingham

    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

  8. vfarcic commented on Aug 10, 2025

    @vfarcic

    +1

  9. nelspir commented on Aug 14, 2025

    @nelspir

    +1

  10. rekram1-node commented on Aug 14, 2025

    @rekram1-node
    Contributor

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

  11. smissingham commented on Aug 23, 2025

    @smissingham

    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 😅

  12. adam-paterson commented on Sep 17, 2025

    @adam-paterson

    +1

  13. john-persson-polestar commented on Sep 18, 2025

    @john-persson-polestar

    +1

  14. nelspir commented on Sep 19, 2025

    @nelspir

    +1

  15. rekram1-node commented on Sep 19, 2025

    @rekram1-node
    Contributor

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

  16. 5 remaining items

  17. VikashLoomba commented on Sep 22, 2025

    @VikashLoomba

    @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.

  18. rekram1-node commented on Sep 22, 2025

    @rekram1-node
    Contributor

    yeah true

  19. kziemski commented on Nov 19, 2025

    @kziemski

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

  20. rekram1-node commented on Nov 19, 2025

    @rekram1-node
    Contributor

    Yeah we can expose that

  21. kziemski commented on Nov 20, 2025

    @kziemski

    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.

  22. luifr10 commented on Nov 25, 2025

    @luifr10

    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?

  23. paoloricciuti commented on Dec 12, 2025

    @paoloricciuti
    Contributor

    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?

  24. kziemski commented on Dec 12, 2025

    @kziemski

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

  25. paoloricciuti commented on Dec 12, 2025

    @paoloricciuti
    Contributor

    @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:

    Screen.Recording.2025-12-12.at.19.28.11.mov
  26. paoloricciuti commented on Jan 1, 2026

    @paoloricciuti
    Contributor

    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 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