// PoC file to test Microsoft ModelContextProtocol SDK // This demonstrates the SDK's attribute-based tool registration using ModelContextProtocol.Server; using System.ComponentModel; namespace ColaFlow.API.Mcp.Sdk; /// /// PoC class to test Microsoft MCP SDK Tool registration /// [McpServerToolType] public class SdkPocTools { /// /// Simple ping tool to test SDK attribute system /// [McpServerTool] [Description("Test tool that returns a pong message")] public static Task Ping() { return Task.FromResult("Pong from Microsoft MCP SDK!"); } /// /// Tool with parameters to test SDK parameter marshalling /// [McpServerTool] [Description("Get project information by ID")] public static Task GetProjectInfo( [Description("Project ID")] Guid projectId, [Description("Include archived projects")] bool includeArchived = false) { return Task.FromResult(new { projectId, name = "SDK PoC Project", status = "active", includeArchived, message = "This is a PoC response from Microsoft MCP SDK" }); } /// /// Tool with dependency injection to test SDK DI integration /// [McpServerTool] [Description("Get server time to test dependency injection")] public static Task GetServerTime(ILogger logger) { logger.LogInformation("GetServerTime tool called via Microsoft MCP SDK"); return Task.FromResult(new { serverTime = DateTime.UtcNow, message = "Dependency injection works!", sdkVersion = "0.4.0-preview.3" }); } }