14 lines
475 B
C#
14 lines
475 B
C#
|
|
using System.ComponentModel;
|
|||
|
|
using ModelContextProtocol.Server;
|
|||
|
|
|
|||
|
|
namespace ConsoleEchoMcpServer.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());
|
|||
|
|
}
|