Skip to content

Include PromptType and Prompt attributes #70

Closed

Description

@aaronpowell

Is your feature request related to a problem? Please describe.
The API for McpToolType and McpTool (combined with the WithTools method) makes it really easy to define tools. It'd be great to have a comparable API for Prompts.

Describe the solution you'd like
I'd like to be able to have code like this:

[PromptType]
public static class SamplePrompt {
  [Prompt, Description("This is a sample prompt")]
  public static string Sample() => "Some sample prompt";
}

// in program.cs
builder.Services
    .AddMcpServer()
    .WithStdioServerTransport()
    .WithTools()
    .WithPrompts();

Describe alternatives you've considered
Currently, the only solution would be to implement this via WithListPromptsHandler and WithGetPromptHandler.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions