Open
Description
Question
This is what happened:
- My MCP server declares a resource called "foo://latest_version"
- My MCP server returns responses for "resources/list" and "resources/read" correctly
- I connect to the MCP server to Claude Desktop
- Claude Desktop calls "resources/list"
- Claude Desktop displays list of tools and resources in "Settings > Integrations" correctly
- I ask "What is the lastest version of Foo" (with web search turned off to prevent distraction from the internet)
- Claude Desktop replies it doesn't know. It should look up the resource (which has a super relevant name, URI and description)
- 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")