AspNetCoreMcpServer 能加到 dify 中
This commit is contained in:
14
AspNetCoreMcpServer/Tools/EchoTool.cs
Normal file
14
AspNetCoreMcpServer/Tools/EchoTool.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using System.ComponentModel;
|
||||
using ModelContextProtocol.Server;
|
||||
|
||||
namespace AspNetCoreMcpServer.Tools;
|
||||
|
||||
[McpServerToolType]
|
||||
public sealed class EchoTool
|
||||
{
|
||||
[McpServerTool, Description("Echoes the message back to the client.")]
|
||||
public static string Echo(string message) => $"Hello from C#: {message}";
|
||||
|
||||
[McpServerTool, Description("Echoes in reverse the message sent.")]
|
||||
public static string ReverseEcho(string message) => string.Concat(message.Reverse());
|
||||
}
|
||||
Reference in New Issue
Block a user