Skip to content

MCP Resources without parameters don't work without mime-type specified #516

Open
@jamesmontemagno

Description

@jamesmontemagno

Describe the bug
Create a new MCP Server with the sample code:

 [McpServerResourceType]
    public sealed class SimpleResources
    {
        [McpServerResource, Description("Some neat direct resource")]
        public static string SomeNeatDirectResource() => "This is a neat resource";

        [McpServerResource, Description("Some neat resource with parameters")]
        public static string SomeNeatTemplatedResource(string name) => $"This is a neat resource with parameters: {name}";
    }

If you call SomeNeatTemplatedResource it will work and ask you for the name, but if you call SomeNeatDirectResource it fails

To Reproduce
Steps to reproduce the behavior:
1.

Expected behavior
A clear and concise description of what you expected to happen.

Logs
If applicable, add logs to help explain your problem.

Additional context
Add any other context about the problem here.

Metadata

Metadata

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