Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Claude Desktop never uses resources from my MCP server #1016

Open
@terrynguyen255

Description

@terrynguyen255

Question

This is what happened:

  1. My MCP server declares a resource called "foo://latest_version"
  2. My MCP server returns responses for "resources/list" and "resources/read" correctly
  3. I connect to the MCP server to Claude Desktop
  4. Claude Desktop calls "resources/list"
  5. Claude Desktop displays list of tools and resources in "Settings > Integrations" correctly
  6. I ask "What is the lastest version of Foo" (with web search turned off to prevent distraction from the internet)
  7. Claude Desktop replies it doesn't know. It should look up the resource (which has a super relevant name, URI and description)
  8. Claude Desktop never calls "resources/read"

I tried these but the behavior persists:

  • Different MCP hosts: Claude Desktop, Claude Web and Cursor AI
  • Differennt resource URIs: foo://latest_version, foo://doc/latest_version, file:///foo/latest_version
  • Different transports: STDIO, SSE, Streamable HTTP
  • Local (at localhost) ans remote (at https://mycompany.example/) MCP servers
  • Different codebases: Cloudflare Wrangler starter, minimal Typescript repo, minimal Python repo

Additional Context

These are responses from my MCP server:

# Method initialization
# Response:
{
  "capabilities": {
    "experimental": {},
    "prompts": {
      "listChanged": false
    },
    "resources": {
      "subscribe": false,
      "listChanged": false
    },
    "tools": {
      "listChanged": false
    }
  },
  "serverInfo": {
    "name": "foo",
    "version": "1.9.3"
  }
}
# Method resources/list
# Request:
{
  "method": "resources/list",
  "params": {}
}
# Response:
{
  "resources": [
    {
      "uri": "foo://latest_version",
      "name": "latest_version",
      "description": "The latest version of Foo",
      "mimeType": "text/plain"
    }
  ]
}
# Method resources/read
# Request:
{
  "method": "resources/read",
  "params": {
    "uri": "foo://latest_version"
  }
}
# Response:
{
  "contents": [
    {
      "uri": "foo://latest_version",
      "mimeType": "text/plain",
      "text": "2.0.1"
    }
  ]
}

My MCP server

from mcp.server.fastmcp import FastMCP
from tavily import TavilyClient
from dotenv import load_dotenv
from typing import Dict, List
import os

load_dotenv()

PORT = os.environ.get("PORT", 10000)

# Create an MCP server
mcp = FastMCP("tavi", host="0.0.0.0", port=PORT)

@mcp.resource("foo://latest_version")
def get_latest_version() -> str:
    return "Current latest version: 12.3.4"


# Run the server
if __name__ == "__main__":
    mcp.run(transport="streamable-http")

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions