Add server-side Streamable HTTP transport support (#330)
- Changes IJsonRpcMessage to an abstract base class so RelatedTransport will always be available - Streamable HTTP supports multiple concurrent HTTP request with their own indpendent SSE response streams - RelatedTransport indicates the source or destination of the JsonRpcMessage - Changes the default RequestId to a JSON number for better compatibility with MCP servers in the wild
This commit is contained in:
parent
7d77be68cf
commit
7dcba357d4
1 changed files with 1637 additions and 395 deletions
|
|
@ -16,16 +16,8 @@ namespace ModelContextProtocol.Protocol.Messages;
|
|||
/// This class represents a successful response with a result. For error responses, see <see cref="JsonRpcError"/>.
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
public record JsonRpcResponse : IJsonRpcMessageWithId
|
||||
public class JsonRpcResponse : JsonRpcMessageWithId
|
||||
{
|
||||
/// <inheritdoc />
|
||||
[JsonPropertyName("jsonrpc")]
|
||||
public string JsonRpc { get; init; } = "2.0";
|
||||
|
||||
/// <inheritdoc />
|
||||
[JsonPropertyName("id")]
|
||||
public required RequestId Id { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the result of the method invocation.
|
||||
/// </summary>
|
||||
|
|
|
|||
Loading…
Reference in a new issue