Add McpClient/Session methods using .Protocol types (#1063)
This commit is contained in:
parent
d76bc16bd1
commit
4a84412331
1 changed files with 1116 additions and 639 deletions
|
|
@ -76,6 +76,11 @@ public sealed class StreamableHttpServerTransport : ITransport
|
|||
/// <param name="sseResponseStream">The response stream to write MCP JSON-RPC messages as SSE events to.</param>
|
||||
/// <param name="cancellationToken">The <see cref="CancellationToken"/> to monitor for cancellation requests. The default is <see cref="CancellationToken.None"/>.</param>
|
||||
/// <returns>A task representing the send loop that writes JSON-RPC messages to the SSE response stream.</returns>
|
||||
/// <exception cref="ArgumentNullException"><paramref name="sseResponseStream"/> is <see langword="null"/>.</exception>
|
||||
/// <exception cref="InvalidOperationException">
|
||||
/// <see cref="Stateless"/> is <see langword="true"/> and GET requests are not supported in stateless mode,
|
||||
/// or a GET request has already been started for this session.
|
||||
/// </exception>
|
||||
public async Task HandleGetRequestAsync(Stream sseResponseStream, CancellationToken cancellationToken = default)
|
||||
{
|
||||
Throw.IfNull(sseResponseStream);
|
||||
|
|
@ -100,13 +105,14 @@ public sealed class StreamableHttpServerTransport : ITransport
|
|||
/// to the <see cref="JsonRpcRequest"/> that initiated the message.
|
||||
/// </summary>
|
||||
/// <param name="message">The JSON-RPC message received from the client via the POST request body.</param>
|
||||
/// <param name="cancellationToken">This token allows for the operation to be canceled if needed. The default is <see cref="CancellationToken.None"/>.</param>
|
||||
/// <param name="cancellationToken">The <see cref="CancellationToken"/> to monitor for cancellation requests. The default is <see cref="CancellationToken.None"/>.</param>
|
||||
/// <param name="responseStream">The POST response body to write MCP JSON-RPC messages to.</param>
|
||||
/// <returns>
|
||||
/// <see langword="true"/> if data was written to the response body.
|
||||
/// <see false="false"/> if nothing was written because the request body did not contain any <see cref="JsonRpcRequest"/> messages to respond to.
|
||||
/// The HTTP application should typically respond with an empty "202 Accepted" response in this scenario.
|
||||
/// </returns>
|
||||
/// <exception cref="ArgumentNullException"><paramref name="message"/> or <paramref name="responseStream"/> is <see langword="null"/>.</exception>
|
||||
/// <remarks>
|
||||
/// If an authenticated <see cref="ClaimsPrincipal"/> sent the message, that can be included in the <see cref="JsonRpcMessage.Context"/>.
|
||||
/// No other part of the context should be set.
|
||||
|
|
|
|||
Loading…
Reference in a new issue