Skip to content

Resource Templates not exposed to Claude UI #92

@MarkusPfundstein

Description

@MarkusPfundstein

Describe the bug
When registered a resource_template with the python sdk (mcp==1.1.0), the server runs but no resources can be selected in the UI.

To Reproduce
Steps to reproduce the behavior:

  1. Add code (see below)
  2. Run server
  3. Open Claude
  4. Try to attach a resource

Expected behavior
I would expect to be able to select a resource template.

Screenshots

*** Resource not displayed
image

*** Server installed (resource_testing)
image

Desktop (please complete the following information):

  • MacOSX
  • Python 3.13
  • mcp 1.1.0

Additional context

This is the code to register the resource templates:

@app.list_resource_templates()
async def list_resource_templates() -> list[ResourceTemplate]:
    return [
        ResourceTemplate(
            uriTemplate=AnyUrl("file://moonshot/posts/{posts}"),
            description="Posts of your moonshot account",
            name="Get posts",
            mimeType="application/json"
        )
    ]

@app.read_resource()
async def read_resource(uri: AnyUrl) -> str:
    logger.error(f"read resource call: {uri}")
    if str(uri).startswith("file://moonshot/posts/"):
        return json.dumps(["post1", "post2", "post3"], indent=2)

    raise ValueError("Resource not found")

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Moderate issues affecting some users, edge cases, potentially valuable featurebugSomething isn't workingready for workEnough information for someone to start working on

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions