Skip to content

Declaring capability to send resource notifications disables resource templates added with WithResources #650

@mikekistler

Description

@mikekistler

Describe the bug

In an MCP Server, if the server is created with the options to declare support to send resource notifications

builder.Services.AddMcpServer(
    options =>
        // Declare support for sending resource subscription notifications
        options.Capabilities = new()
        {
            Resources = new()
            {
                Subscribe = true,

            }
        }
    )
    .WithHttpTransport()
    .WithResources<LiveResources>();

the resources added using WithResources are not exposed to the client.

Removing the options => ... from the AddMcpServer parameters results in the resources being exposed but then the capability is not declared to the client.

To Reproduce

I can share a project that repros the problem if needed.

Expected behavior

I should be able to declare support for resource subscriptions and still use WithResources to expose resources.

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