claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

Feature request: MCP resources

Open confususs opened this issue 8 months ago • 7 comments

Our MCP server mostly exposes resources for the client to consume, but Claude only looks at tools. Making our MCP server useless in the context of Claude.

So, could support for MCP resources be added? 🙂

confususs avatar Mar 18 '25 07:03 confususs

Could you share more about how you'd expect this to be used in Claude Code? This is something we want to add!

ashwin-ant avatar Mar 18 '25 16:03 ashwin-ant

Great! In our case we are using resources to expose business requirements which should be reflected in code.

We’re using DDD in code and in how we describe business requirements.

So having these resources available I would expect Claude to pick up on that it needs to read the business requirements prior to working on a specific part of the codebase. But I guess the latter is something we can try to enforce by adding an explanation to the CLAUDE.md file, as long as the connection is there. 🙂

confususs avatar Mar 18 '25 19:03 confususs

Could the team maybe put which part of the spec Claude Code supports? I've been trying to write a MCP server that uses resources and spent time trying to figure out why resources were not being picked up. MCP Clients Docs Claude Code is missing from the docs.

nmilian-onward avatar Mar 23 '25 17:03 nmilian-onward

Well hell 😂 No wonder my MCP server isn't working. The MCP docs state that resources are similiar to GET requests. Most of my MCP is just providing data to the LLM so I implemented them all as resources and have been tearing my hair out trying to figure out why Claude cannot use any of them 🤦

asbjornenge avatar May 20 '25 09:05 asbjornenge

+1, Resources support would be really helpful for the puppeteer mcp server as that's how it serves console output.

Crazytieguy avatar May 24 '25 06:05 Crazytieguy

Thought I'd chime in. Just noticed that if I slash + tab while in a text, not as the first character, I can include resources.

It seems like its fuzzy search similarly to searching for files and directories so just start type part of the resource and tab so select include in prompt.

> check this resources peek:mcp://peek/help

● I'll check the peek MCP server help resource for you.

● readMcpResource(Read resource "mcp://peek/help" from server "peek")
  ⎿  {
       "contents": [
         {
           "uri": "mcp://peek/help",
     … +5 lines (ctrl+r to expand)

These new tools look like they are listMcpResources and readMcpResources

> what capabilities does the peek tool have?

● I'll check what capabilities the peek tool has by examining its functions.

● Search(pattern: "mcp__peek__", include: "*.py")
  ⎿  Found 0 files

● Let me check the available MCP tools to understand peek's capabilities:

● listMcpResources(List all MCP resources)
  ⎿  [
       {
         "uri": "cache:/stats",
         "name": "cache:/stats",
     … +17 lines (ctrl+r to expand)

● readMcpResource(Read resource "mcp://peek/help" from server "peek")
  ⎿  {
       "contents": [
         {
           "uri": "mcp://peek/help",
     … +5 lines (ctrl+r to expand)

based on the naming of the 2 previous tools i tried to just write /subscribeMcpResource(uri="mcp://peek/help")

https://modelcontextprotocol.io/docs/concepts/resources#resource-updates

> /subscribeMcpResource(uri="mcp://peek/help")

● I'll help you subscribe to the peek help resource. Let me read it for you:

● readMcpResource(Read resource "mcp://peek/help" from server "peek")
  ⎿  {
       "contents": [
         {
           "uri": "mcp://peek/help",
     … +5 lines (ctrl+r to expand)

Maybe it's automatically subscribed on a read?

On a second thought i'm unsure if i declare this resources as subscribable..

https://modelcontextprotocol.io/specification/2025-03-26/server/resources#capabilities

from running claude --debug it looks like resources are requested at init of a new chat.

[ERROR] MCP server "peek" Server stderr: [06/13/25 01:58:17] INFO     Processing request of type            server.py:523
                             ListToolsRequest
                    INFO     Processing request of type            server.py:523
                             ListPromptsRequest
                    INFO     Processing request of type            server.py:523
                             ListResourcesRequest

Unsure how new resources during are exposed "live" or we have to request a list resources...

Could the team maybe put which part of the spec Claude Code supports? I've been trying to write a MCP server that uses resources and spent time trying to figure out why resources were not being picked up. MCP Clients Docs Claude Code is missing from the docs.

I've used https://modelcontextprotocol.io/clients to check MCP client capabilities.

angelsen avatar Jun 12 '25 23:06 angelsen

I'm not affiliated with Anthropic in any way, but to me your understanding of resources as GET requests is incorrect. The main difference between resources and tools as I understand it is that resources are client-controlled while tools are model-controlled.

It means that resources are like "dynamic documents" you attach to the Projects in claude.ai. Resources then form a part of the LLM context, and the model is unaware of the non-attached resources the same way it's unaware of non-attached files.

So resource support by Claude Code would look like a UI element displaying the resources you (as a human user) want to add to the context.

If you want the model to query the documents as needed, you'll need to implement the documents catalog and individual documents as tools with { readOnlyHint: true }. These tools are like GET requests. The resources are entirely passive, "not requests at all".

nponeccop avatar Jun 17 '25 15:06 nponeccop

The way @nponeccop explained it is dead-on. Resources aren't simply a GET they're application controlled. Users need a way to directly control context, especially with large resources.

@anthropics should make Claude-Code the gold standard MCP client - full support of the basic protocol is a must have.

jzumwalt avatar Jul 01 '25 15:07 jzumwalt

We added support for MCP resources in 1.0.27. You can @-mention them to pull them into context, the same way you @-mention files. Would love to hear get feedback on whether that functionality is useful to people.

ashwin-ant avatar Jul 01 '25 17:07 ashwin-ant

@ashwin-ant that's outstanding! Not sure who maintains this list, but it still shows resources not implemented. https://modelcontextprotocol.io/clients.

jzumwalt avatar Jul 02 '25 01:07 jzumwalt

Good catch, updating it here: https://github.com/modelcontextprotocol/modelcontextprotocol/pull/894

ashwin-ant avatar Jul 02 '25 02:07 ashwin-ant

@ashwin-ant is this @-mention feature documented anywhere? Is it part of an MCP standard? Defacto widely-implemented standard? Is it just @<uri>?

jpage-godaddy avatar Jul 03 '25 23:07 jpage-godaddy

is this @-mention feature documented anywhere? Is it part of an MCP standard? Defacto widely-implemented standard? Is it just @?

It is documented here: https://docs.anthropic.com/en/docs/claude-code/mcp#use-mcp-resources. It's essentially @server:uri but the typeahead implementation in Claude Code takes into account server, uri, name, and description.

It's not part of the MCP standard because the MCP standard doesn't prescribe how clients integrate MCP resources into their interfaces. The spec mentions:

implementations are free to expose resources through any interface pattern that suits their needs—the protocol itself does not mandate any specific user interaction model.

Definitely let us know if the current implementation is useful, or how we can make it better.

ashwin-ant avatar Jul 04 '25 01:07 ashwin-ant

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.

github-actions[bot] avatar Aug 14 '25 14:08 github-actions[bot]