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

Dynamic MCP resources not discovered in claude code

Open shouhengyi opened this issue 5 months ago • 8 comments

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: https://github.com/modelcontextprotocol/python-sdk/issues/263

See this comment https://github.com/modelcontextprotocol/python-sdk/issues/263#issuecomment-2729617662 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.

shouhengyi avatar Jul 22 '25 00:07 shouhengyi

I have the same problem, but from yesterday it escalated that I cannot even use dynamically registered tool.

Described in #4526

dacz avatar Jul 27 '25 08:07 dacz

Found 1 possible duplicate issue:

  1. https://github.com/anthropics/claude-code/issues/3326

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

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

I'm having the same issue. I have one tool enabled by default, and calling that tool enables a second tool. But despite the call to .enable(), Claude Code is unable to detect the change to the tools list. It seems like Claude Code is not picking up the listChanged notification (related docs here).

RobbieMcKinstry avatar Aug 16 '25 20:08 RobbieMcKinstry

I am also experiencing this bug in Claude Desktop with an MCP server developed in Python. The two static resources are available but the dynamic one isn't available in any way.

simongray avatar Sep 03 '25 16:09 simongray

Hi @ollie-anthropic, Is there any update on this issue? Seems like there are many people with the same problem including myself. Thanks!

arneyjfs avatar Sep 26 '25 15:09 arneyjfs

Same issue here. Having dynamic templates supported by Claude code would be very helpful.

rockdaboot avatar Oct 10 '25 15:10 rockdaboot

This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.

github-actions[bot] avatar Dec 10 '25 10:12 github-actions[bot]

Still actual

laurynas-biveinis avatar Dec 10 '25 13:12 laurynas-biveinis