You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
518 B
C#
22 lines
518 B
C#
using System;
|
|
using System.ComponentModel;
|
|
|
|
using ModelContextProtocol.Server;
|
|
|
|
namespace McpStudy.Core
|
|
{
|
|
[McpServerToolType]
|
|
public static class EchoTool
|
|
{
|
|
[McpServerTool, DisplayName("EchoServer"), Description("回传原消息给客户端!")]
|
|
public static string Echo(string message)
|
|
{
|
|
Console.WriteLine($"Echo: {message}");
|
|
|
|
System.IO.File.AppendAllText("Mcplog.txt", $"Echo: {message}\n");
|
|
|
|
return $"hello {message}";
|
|
}
|
|
}
|
|
}
|