You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
If trying to declare custom prompt provider I have to create a all the prompt attributes manually, these attributes should be exposed Protocol.Types. Also, when doing so, it also requires you to leverage common classes like Message, MessageContent, TextMessageContent etc. All these types should be exposed via Protocol.Types
To Reproduce
Steps to reproduce the behavior:
Open the AspNetCoreSseServer sample, create a Prompts folder.
Create a CodeReviewPrompts.cs class and paste the following code in the .CS
3.using AspNetCoreSseServer.Attributes;
using System.ComponentModel;
using ModelContextProtocol;
using ModelContextProtocol.Protocol.Types;
using ModelContextProtocol.Server;
namespace AspNetCoreSseServer.Prompts
{
// Example prompt type
[McpPromptType]
public static class CodeReviewPrompts
{
[McpPrompt]
[Description("Generate a code review for the given code sample")]
public static IEnumerable ReviewCode(
[McpPromptArgument(Required = true)]
[Description("Code to review")]
string code,
[McpPromptArgument(Required = false)]
[Description("Programming language of the code")]
string language = "csharp")
{
// Return a list of messages that form the prompt
return new List<Message>
{
new Message
{
Role = "user",
Content = new List<MessageContent>
{
new TextMessageContent
{
Text = $"Please review this {language} code carefully and provide feedback on best practices, potential bugs, and any improvements that could be made:"
}
}
},
new Message
{
Role = "user",
Content = new List<MessageContent>
{
new TextMessageContent
{
Text = $"```{language}\n{code}\n```"
}
}
}
};
}
}
What you will find, is that I have to manually create all the classes including the attribute classes as well, which is a lot of repeatable code that can be abstracted away in the package itself.
Expected behavior
By simply referencing the package and adding a using ModelContextProtocol.Protocols.Types all the proper attributes and common classes should be available to me as these will be reused throughout all MCP solutions.
Logs
If applicable, add logs to help explain your problem.
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered:
Describe the bug
If trying to declare custom prompt provider I have to create a all the prompt attributes manually, these attributes should be exposed Protocol.Types. Also, when doing so, it also requires you to leverage common classes like Message, MessageContent, TextMessageContent etc. All these types should be exposed via Protocol.Types
To Reproduce
Steps to reproduce the behavior:
3.using AspNetCoreSseServer.Attributes;
using System.ComponentModel;
using ModelContextProtocol;
using ModelContextProtocol.Protocol.Types;
using ModelContextProtocol.Server;
namespace AspNetCoreSseServer.Prompts
{
// Example prompt type
[McpPromptType]
public static class CodeReviewPrompts
{
[McpPrompt]
[Description("Generate a code review for the given code sample")]
public static IEnumerable ReviewCode(
[McpPromptArgument(Required = true)]
[Description("Code to review")]
string code,
What you will find, is that I have to manually create all the classes including the attribute classes as well, which is a lot of repeatable code that can be abstracted away in the package itself.
Expected behavior
By simply referencing the package and adding a using ModelContextProtocol.Protocols.Types all the proper attributes and common classes should be available to me as these will be reused throughout all MCP solutions.
Logs
If applicable, add logs to help explain your problem.
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: