Skip to content

Support for resources and prompts #79

@unbekanntes-pferd

Description

@unbekanntes-pferd

Is your feature request related to a problem? Please describe.
There's no convenience way to declare resources analogue to the tool macro - I'd like to be able to declare resources (and a bit less also prompts) in the same way as currently possible via tool macro.

Describe the solution you'd like
For resources:
Ideally, some sort of macro that allows passing the path ("myresource://something") and also templating ("myresource://{somethingId}").

From prompts, analogue templating capabilities with params via macro, although granted, less important.

Describe alternatives you've considered
It appears that the only alternative is to just use tools for everything (see e.g. the file system implementation: https://rust-mcp-stack.github.io/rust-mcp-filesystem/#/)

Additional context
My current understanding of resources vs. tools is as follows:

  • tools perform actions, equivalent to POST / PUT / DELETE requests, either modifying or creating state (whatever that state is)
  • resources are read-only and equivalent to GET requests, returning static or dynamic content available under specific routes

I'd like to create an MCP server for a REST API (hence the comparison to HTTP requests above) and I do not want to expose everything as a tool, as it does not seem the intention of the MCP protocol as far as I understood these concepts (tools, resources, prompts).
Interestingly, the official SDK rmcp also does not implement it - so if my understanding is off, let me know.
If there's any way to contribute, I'd be happy to look into it.

Metadata

Metadata

Assignees

No one assigned

    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