Skip to content

Resource Templates not exposed to Claude UI #92

Open
@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

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions