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:
parent
c384c7d3de
commit
8fe797e1f3
1 changed files with 2668 additions and 659 deletions
27
src/mcpdotnet/Protocol/Transport/ITransport.cs
Normal file
27
src/mcpdotnet/Protocol/Transport/ITransport.cs
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
using System.Threading.Channels;
|
||||
using McpDotNet.Protocol.Messages;
|
||||
|
||||
namespace McpDotNet.Protocol.Transport;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a transport mechanism for MCP communication.
|
||||
/// </summary>
|
||||
public interface ITransport : 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>
|
||||
/// 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);
|
||||
}
|
||||
Loading…
Reference in a new issue