This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System.Buffers; | |
| using System.Net.WebSockets; | |
| var builder = WebApplication.CreateBuilder(args); | |
| var app = builder.Build(); | |
| app.MapGet("/ws", async (HttpContext context) => | |
| { | |
| const int MaxMessageSize = 1024 * 1024; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /// Written with “powerful” inspiration from the https://pub.dev/packages/email_validator. | |
| /// An abstract strategy for validating objects of type [T]. | |
| /// | |
| /// Implementations of this class define specific validation rules | |
| /// for a given type, allowing flexible and reusable validation logic. | |
| abstract class ValidationStrategy<T, E extends Exception> { | |
| /// Validates the given [value] of type [T]. | |
| /// | |
| /// If the validation fails, an exception of type [E] is thrown. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #r "nuget: ModelContextProtocol,0.4.0-preview.1" | |
| open ModelContextProtocol.Client | |
| open ModelContextProtocol.Protocol | |
| open System | |
| open System.Threading.Tasks | |
| module McpClient = | |
| let clientTransport = | |
| StdioClientTransport( | |
| StdioClientTransportOptions( |
OlderNewer