Server support (stdio) (#19)

* Server support (stdio)
* TestServer project
* Refactored McpClient class to extract shared endpoint logic (with McpServer) to a base class, McpJsonRpcEndpoint.
* Improved xmldoc comments for protocol types, mirroring specification schema comments.
* Update README.MD
This commit is contained in:
Peder Holdgaard Pedersen 2025-02-08 16:21:26 +01:00 • committed by GitHub
commit 8fe797e1f3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,32 +0,0 @@
using System.Threading.Channels;
using McpDotNet.Protocol.Messages;
namespace McpDotNet.Protocol.Transport;
/// <summary>
/// Represents a transport mechanism for MCP communication.
/// </summary>
public interface IMcpTransport : IAsyncDisposable
{
/// <summary>
/// Gets whether the transport is currently connected.
/// </summary>
bool IsConnected { get; }
/// <summary>
/// Channel for receiving messages from the transport.
/// </summary>
ChannelReader<IJsonRpcMessage> MessageReader { get; }
/// <summary>
/// Establishes the transport connection.
/// </summary>
/// <param name="cancellationToken">Token to cancel the operation.</param>
Task ConnectAsync(CancellationToken cancellationToken = default);
/// <summary>
/// Sends a message through the transport.
/// </summary>
/// <param name="message">The message to send.</param>
/// <param name="cancellationToken">Token to cancel the operation.</param>
Task SendMessageAsync(IJsonRpcMessage message, CancellationToken cancellationToken = default);
}