Skip to content

Dynamic MCP resources not discovered in claude code #4110

@shouhengyi

Description

@shouhengyi

Description

Claude Code can list static MCP resources and MCP tools, but not dynamic MCP resources.

To be more specific:

from mcp.server.fastmcp import FastMCP

# Create an MCP server
mcp = FastMCP("Demo")

# Add an addition tool
@mcp.tool() <<<<<<<<<<<<<< This works. Can be discovered in Claude Code.
def add(a: int, b: int) -> int:
    """Add two numbers"""
    return a + b


# Add a dynamic greeting resource
@mcp.resource("greeting://{name}")  <<<<<<<<<<<<<<< This doesn't.
def get_greeting(name: str) -> str:
    """Get a personalized greeting"""
    return f"Hello, {name}!"

Same issue was surfaced in the Claude Deskop as well: modelcontextprotocol/python-sdk#263

See this comment modelcontextprotocol/python-sdk#263 (comment) which seems to be the reason.

I was using https://www.npmjs.com/package/@anthropic-ai/claude-code v1.0.56.

This makes Claude Code less useful since dynamic MCP resources are very important to build production MCP servers.

Metadata

Metadata

Labels

area:mcpbugSomething isn't workinghas reproHas detailed reproduction steps

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions