MCP Core docs edit pass (#1033)

Co-authored-by: Stephen Toub <stoub@microsoft.com>
This commit is contained in:
Genevieve Warren 2025-11-26 05:36:19 -08:00 • committed by GitHub
commit 6ed728d005
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
21 changed files with 452 additions and 447 deletions

View file

@ -6,7 +6,7 @@ using System.Text.Json.Nodes;
namespace ModelContextProtocol.Server;
/// <summary>
/// Used to specify metadata for an MCP server primitive (tool, prompt, or resource).
/// Specifies metadata for an MCP server primitive (tool, prompt, or resource).
/// </summary>
/// <remarks>
/// <para>
@ -24,7 +24,7 @@ namespace ModelContextProtocol.Server;
/// </para>
/// </remarks>
/// <example>
/// <code>
/// <code language="csharp">
/// [McpServerTool]
/// [McpMeta("model", "gpt-4o")]
/// [McpMeta("version", "1.0")]
@ -60,10 +60,10 @@ public sealed class McpMetaAttribute : Attribute
}
/// <summary>
/// Initializes a new instance of the <see cref="McpMetaAttribute"/> class with a boolean value.
/// Initializes a new instance of the <see cref="McpMetaAttribute"/> class with a Boolean value.
/// </summary>
/// <param name="name">The name (key) of the metadata entry.</param>
/// <param name="value">The boolean value of the metadata entry.</param>
/// <param name="value">The Boolean value of the metadata entry.</param>
public McpMetaAttribute(string name, bool value)
{
Name = name;
@ -85,16 +85,16 @@ public sealed class McpMetaAttribute : Attribute
/// <remarks>
/// <para>
/// This value must be well-formed JSON. It will be parsed and added to the metadata <see cref="JsonObject"/>.
/// Simple values can be represented as JSON literals like <c>"\"my-string\""</c>, <c>"123"</c>,
/// <c>"true"</c>, etc. Complex structures can be represented as JSON objects or arrays.
/// Simple values can be represented as JSON literals like <c>"\"my-string\""</c>, <c>"123"</c>,
/// or <c>"true"</c>. Complex structures can be represented as JSON objects or arrays.
/// </para>
/// <para>
/// Setting this property will override any value provided via the constructor.
/// Setting this property overrides any value provided via the constructor.
/// </para>
/// <para>
/// For programmatic scenarios where you want to construct complex metadata without dealing with
/// JSON strings, use the <see cref="McpServerToolCreateOptions.Meta"/>,
/// <see cref="McpServerPromptCreateOptions.Meta"/>, or <see cref="McpServerResourceCreateOptions.Meta"/>
/// JSON strings, use the <see cref="McpServerToolCreateOptions.Meta"/>,
/// <see cref="McpServerPromptCreateOptions.Meta"/>, or <see cref="McpServerResourceCreateOptions.Meta"/>
/// property to provide a JsonObject directly.
/// </para>
/// </remarks>

View file

@ -28,13 +28,12 @@ public abstract partial class McpServer : McpSession, IMcpServer
/// <summary>
/// Creates a new instance of an <see cref="McpServer"/>.
/// </summary>
/// <param name="transport">Transport to use for the server representing an already-established MCP session.</param>
/// <param name="transport">The transport to use for the server representing an already-established MCP session.</param>
/// <param name="serverOptions">Configuration options for this server, including capabilities. </param>
/// <param name="loggerFactory">Logger factory to use for logging. If null, logging will be disabled.</param>
/// <param name="serviceProvider">Optional service provider to create new instances of tools and other dependencies.</param>
/// <returns>An <see cref="McpServer"/> instance that should be disposed when no longer needed.</returns>
/// <exception cref="ArgumentNullException"><paramref name="transport"/> is <see langword="null"/>.</exception>
/// <exception cref="ArgumentNullException"><paramref name="serverOptions"/> is <see langword="null"/>.</exception>
/// <exception cref="ArgumentNullException"><paramref name="transport"/> or <paramref name="serverOptions"/> is <see langword="null"/>.</exception>
public static McpServer Create(
ITransport transport,
McpServerOptions serverOptions,
@ -207,7 +206,7 @@ public abstract partial class McpServer : McpSession, IMcpServer
}
/// <summary>Gets an <see cref="ILogger"/> on which logged messages will be sent as notifications to the client.</summary>
/// <returns>An <see cref="ILogger"/> that can be used to log to the client..</returns>
/// <returns>An <see cref="ILogger"/> that can be used to log to the client.</returns>
public ILoggerProvider AsClientLoggerProvider()
{
return new ClientLoggerProvider(this);
@ -341,7 +340,7 @@ public abstract partial class McpServer : McpSession, IMcpServer
/// <param name="type">The type to create the schema for.</param>
/// <param name="serializerOptions">The serializer options to use.</param>
/// <returns>The created primitive schema definition.</returns>
/// <exception cref="McpProtocolException">Thrown when the type is not supported.</exception>
/// <exception cref="McpProtocolException">The type is not supported.</exception>
private static ElicitRequestParams.PrimitiveSchemaDefinition CreatePrimitiveSchema(Type type, JsonSerializerOptions serializerOptions)
{
if (type.IsGenericType && type.GetGenericTypeDefinition() == typeof(Nullable<>))

View file

@ -12,7 +12,7 @@ namespace ModelContextProtocol.Server;
public sealed class McpServerFilters
{
/// <summary>
/// Gets the filters for the list tools handler pipeline.
/// Gets the filters for the list-tools handler pipeline.
/// </summary>
/// <remarks>
/// <para>
@ -29,7 +29,7 @@ public sealed class McpServerFilters
public List<McpRequestFilter<ListToolsRequestParams, ListToolsResult>> ListToolsFilters { get; } = [];
/// <summary>
/// Gets the filters for the call tool handler pipeline.
/// Gets the filters for the call-tool handler pipeline.
/// </summary>
/// <remarks>
/// These filters wrap handlers that are invoked when a client makes a call to a tool that isn't found in the <see cref="McpServerTool"/> collection.
@ -39,7 +39,7 @@ public sealed class McpServerFilters
public List<McpRequestFilter<CallToolRequestParams, CallToolResult>> CallToolFilters { get; } = [];
/// <summary>
/// Gets the filters for the list prompts handler pipeline.
/// Gets the filters for the list-prompts handler pipeline.
/// </summary>
/// <remarks>
/// <para>
@ -56,7 +56,7 @@ public sealed class McpServerFilters
public List<McpRequestFilter<ListPromptsRequestParams, ListPromptsResult>> ListPromptsFilters { get; } = [];
/// <summary>
/// Gets the filters for the get prompt handler pipeline.
/// Gets the filters for the get-prompt handler pipeline.
/// </summary>
/// <remarks>
/// These filters wrap handlers that are invoked when a client requests details for a specific prompt that isn't found in the <see cref="McpServerPrompt"/> collection.
@ -66,7 +66,7 @@ public sealed class McpServerFilters
public List<McpRequestFilter<GetPromptRequestParams, GetPromptResult>> GetPromptFilters { get; } = [];
/// <summary>
/// Gets the filters for the list resource templates handler pipeline.
/// Gets the filters for the list-resource-templates handler pipeline.
/// </summary>
/// <remarks>
/// These filters wrap handlers that return a list of available resource templates when requested by a client.
@ -77,7 +77,7 @@ public sealed class McpServerFilters
public List<McpRequestFilter<ListResourceTemplatesRequestParams, ListResourceTemplatesResult>> ListResourceTemplatesFilters { get; } = [];
/// <summary>
/// Gets the filters for the list resources handler pipeline.
/// Gets the filters for the list-resources handler pipeline.
/// </summary>
/// <remarks>
/// These filters wrap handlers that return a list of available resources when requested by a client.
@ -88,7 +88,7 @@ public sealed class McpServerFilters
public List<McpRequestFilter<ListResourcesRequestParams, ListResourcesResult>> ListResourcesFilters { get; } = [];
/// <summary>
/// Gets the filters for the read resource handler pipeline.
/// Gets the filters for the read-resource handler pipeline.
/// </summary>
/// <remarks>
/// These filters wrap handlers that are invoked when a client requests the content of a specific resource identified by its URI.
@ -98,7 +98,7 @@ public sealed class McpServerFilters
public List<McpRequestFilter<ReadResourceRequestParams, ReadResourceResult>> ReadResourceFilters { get; } = [];
/// <summary>
/// Gets the filters for the complete handler pipeline.
/// Gets the filters for the complete-handler pipeline.
/// </summary>
/// <remarks>
/// These filters wrap handlers that provide auto-completion suggestions for prompt arguments or resource references in the Model Context Protocol.
@ -109,7 +109,7 @@ public sealed class McpServerFilters
public List<McpRequestFilter<CompleteRequestParams, CompleteResult>> CompleteFilters { get; } = [];
/// <summary>
/// Gets the filters for the subscribe to resources handler pipeline.
/// Gets the filters for the subscribe-to-resources handler pipeline.
/// </summary>
/// <remarks>
/// <para>
@ -126,7 +126,7 @@ public sealed class McpServerFilters
public List<McpRequestFilter<SubscribeRequestParams, EmptyResult>> SubscribeToResourcesFilters { get; } = [];
/// <summary>
/// Gets the filters for the unsubscribe from resources handler pipeline.
/// Gets the filters for the unsubscribe-from-resources handler pipeline.
/// </summary>
/// <remarks>
/// <para>
@ -143,7 +143,7 @@ public sealed class McpServerFilters
public List<McpRequestFilter<UnsubscribeRequestParams, EmptyResult>> UnsubscribeFromResourcesFilters { get; } = [];
/// <summary>
/// Gets the filters for the set logging level handler pipeline.
/// Gets the filters for the set-logging-level handler pipeline.
/// </summary>
/// <remarks>
/// <para>

View file

@ -159,7 +159,7 @@ public sealed class McpServerHandlers
/// <summary>Gets or sets notification handlers to register with the server.</summary>
/// <remarks>
/// <para>
/// When constructed, the server will enumerate these handlers once, which may contain multiple handlers per notification method key.
/// When constructed, the server will enumerate these handlers, which may contain multiple handlers per notification method key, once.
/// The server will not re-enumerate the sequence after initialization.
/// </para>
/// <para>

View file

@ -21,7 +21,7 @@ public sealed class McpServerOptions
/// </summary>
/// <remarks>
/// These determine which features will be available when a client connects.
/// Capabilities can include "tools", "prompts", "resources", "logging", and other
/// Capabilities can include "tools", "prompts", "resources", "logging", and other
/// protocol-specific functionality.
/// </remarks>
public ServerCapabilities? Capabilities { get; set; }
@ -61,12 +61,12 @@ public sealed class McpServerOptions
public string? ServerInstructions { get; set; }
/// <summary>
/// Gets or sets whether to create a new service provider scope for each handled request.
/// Gets or sets a value that indicates whether to create a new service provider scope for each handled request.
/// </summary>
/// <remarks>
/// The default is <see langword="true"/>. When <see langword="true"/>, each invocation of a request
/// handler will be invoked within a new service scope.
/// </remarks>
/// <value>
/// <see langword="true"/> if each invocation of a request handler is invoked within a new service scope.
/// The default is <see langword="true"/>.
/// </value>
public bool ScopeRequests { get; set; } = true;
/// <summary>
@ -84,8 +84,8 @@ public sealed class McpServerOptions
/// Gets the filter collections for MCP server handlers.
/// </summary>
/// <remarks>
/// This property provides access to filter collections that can be used to modify the behavior
/// of various MCP server handlers. Filters are applied in reverse order, so the last filter
/// This property provides access to filter collections that can be used to modify the behavior
/// of various MCP server handlers. Filters are applied in reverse order, so the last filter
/// added will be the outermost (first to execute).
/// </remarks>
public McpServerFilters Filters { get; } = new();
@ -93,12 +93,12 @@ public sealed class McpServerOptions
/// <summary>
/// Gets or sets the container of handlers used by the server for processing protocol messages.
/// </summary>
public McpServerHandlers Handlers
{
public McpServerHandlers Handlers
{
get => field ??= new();
set
{
Throw.IfNull(value);
{
Throw.IfNull(value);
field = value;
}
}
@ -143,7 +143,7 @@ public sealed class McpServerOptions
/// when those are provided:
/// </para>
/// <para>
/// - For <see cref="RequestMethods.PromptsList"/> requests: The server returns all prompts from this collection
/// - For <see cref="RequestMethods.PromptsList"/> requests: The server returns all prompts from this collection
/// plus any additional prompts provided by the <see cref="McpServerHandlers.ListPromptsHandler"/> if it's set.
/// </para>
/// <para>
@ -156,14 +156,12 @@ public sealed class McpServerOptions
/// <summary>
/// Gets or sets the default maximum number of tokens to use for sampling requests when not explicitly specified.
/// </summary>
/// <value>
/// The default maximum number of tokens to use for sampling requests. The default value is 1000 tokens.
/// </value>
/// <remarks>
/// <para>
/// This value is used in <see cref="McpServer.SampleAsync(IEnumerable{Microsoft.Extensions.AI.ChatMessage}, Microsoft.Extensions.AI.ChatOptions?, CancellationToken)"/>
/// when <see cref="Microsoft.Extensions.AI.ChatOptions.MaxOutputTokens"/> is not set in the request options.
/// </para>
/// <para>
/// The default value is 1000 tokens.
/// </para>
/// </remarks>
public int MaxSamplingOutputTokens { get; set; } = 1000;
}

View file

@ -5,7 +5,7 @@ using System.Diagnostics.CodeAnalysis;
namespace ModelContextProtocol.Server;
/// <summary>Provides a thread-safe collection of <typeparamref name="T"/> instances, indexed by their names.</summary>
/// <typeparam name="T">Specifies the type of primitive stored in the collection.</typeparam>
/// <typeparam name="T">The type of primitive stored in the collection.</typeparam>
public class McpServerPrimitiveCollection<T> : ICollection<T>, IReadOnlyCollection<T>
where T : IMcpServerPrimitive
{
@ -22,15 +22,15 @@ public class McpServerPrimitiveCollection<T> : ICollection<T>, IReadOnlyCollecti
/// <summary>Occurs when the collection is changed.</summary>
/// <remarks>
/// By default, this is raised when a primitive is added or removed. However, a derived implementation
/// may raise this event for other reasons, such as when a primitive is modified.
/// By default, this event is raised when a primitive is added or removed. However, a derived implementation
/// might raise this event for other reasons, such as when a primitive is modified.
/// </remarks>
public event EventHandler? Changed;
/// <summary>Gets the number of primitives in the collection.</summary>
public int Count => _primitives.Count;
/// <summary>Gets whether there are any primitives in the collection.</summary>
/// <summary>Gets a value that indicates whether there are any primitives in the collection.</summary>
public bool IsEmpty => _primitives.IsEmpty;
/// <summary>Raises <see cref="Changed"/> if there are registered handlers.</summary>
@ -86,10 +86,10 @@ public class McpServerPrimitiveCollection<T> : ICollection<T>, IReadOnlyCollecti
return added;
}
/// <summary>Removes the specified primitivefrom the collection.</summary>
/// <summary>Removes the specified primitive from the collection.</summary>
/// <param name="primitive">The primitive to be removed from the collection.</param>
/// <returns>
/// <see langword="true"/> if the primitive was found in the collection and removed; otherwise, <see langword="false"/> if it couldn't be found.
/// <see langword="true"/> if the primitive was found in the collection and removed; <see langword="false"/> if it wasn't found.
/// </returns>
/// <exception cref="ArgumentNullException"><paramref name="primitive"/> is <see langword="null"/>.</exception>
public virtual bool Remove(T primitive)
@ -109,7 +109,7 @@ public class McpServerPrimitiveCollection<T> : ICollection<T>, IReadOnlyCollecti
/// <param name="name">The name of the primitive to retrieve.</param>
/// <param name="primitive">The primitive, if found; otherwise, <see langword="null"/>.</param>
/// <returns>
/// <see langword="true"/> if the primitive was found in the collection and return; otherwise, <see langword="false"/> if it couldn't be found.
/// <see langword="true"/> if the primitive was found in the collection and returned; <see langword="false"/> if it wasn't found.
/// </returns>
/// <exception cref="ArgumentNullException"><paramref name="name"/> is <see langword="null"/>.</exception>
public virtual bool TryGetPrimitive(string name, [NotNullWhen(true)] out T? primitive)
@ -120,7 +120,7 @@ public class McpServerPrimitiveCollection<T> : ICollection<T>, IReadOnlyCollecti
/// <summary>Checks if a specific primitive is present in the collection of primitives.</summary>
/// <param name="primitive">The primitive to search for in the collection.</param>
/// <see langword="true"/> if the primitive was found in the collection and return; otherwise, <see langword="false"/> if it couldn't be found.
/// <see langword="true"/> if the primitive was found in the collection and returned; <see langword="false"/> if it wasn't found.
/// <exception cref="ArgumentNullException"><paramref name="primitive"/> is <see langword="null"/>.</exception>
public virtual bool Contains(T primitive)
{
@ -160,4 +160,4 @@ public class McpServerPrimitiveCollection<T> : ICollection<T>, IReadOnlyCollecti
/// <inheritdoc/>
bool ICollection<T>.IsReadOnly => false;
}
}

View file

@ -10,7 +10,7 @@ namespace ModelContextProtocol.Server;
/// </summary>
/// <remarks>
/// <para>
/// This attribute is applied to methods that should be exposed as prompts in the Model Context Protocol. When a class
/// This attribute is applied to methods that should be exposed as prompts in the Model Context Protocol. When a class
/// containing methods marked with this attribute is registered with McpServerBuilderExtensions,
/// these methods become available as prompts that can be called by MCP clients.
/// </para>
@ -52,15 +52,15 @@ namespace ModelContextProtocol.Server;
/// </item>
/// <item>
/// <description>
/// When the <see cref="McpServerPrompt"/> is constructed, it may be passed an <see cref="IServiceProvider"/> via
/// When the <see cref="McpServerPrompt"/> is constructed, it may be passed an <see cref="IServiceProvider"/> via
/// <see cref="McpServerPromptCreateOptions.Services"/>. Any parameter that can be satisfied by that <see cref="IServiceProvider"/>
/// according to <see cref="IServiceProviderIsService"/> will be resolved from the <see cref="IServiceProvider"/> provided to the
/// according to <see cref="IServiceProviderIsService"/> will be resolved from the <see cref="IServiceProvider"/> provided to the
/// prompt invocation rather than from the argument collection.
/// </description>
/// </item>
/// <item>
/// <description>
/// Any parameter attributed with <see cref="FromKeyedServicesAttribute"/> will similarly be resolved from the
/// Any parameter attributed with <see cref="FromKeyedServicesAttribute"/> will similarly be resolved from the
/// <see cref="IServiceProvider"/> provided to the prompt invocation rather than from the argument collection.
/// </description>
/// </item>
@ -71,7 +71,7 @@ namespace ModelContextProtocol.Server;
/// </para>
/// <para>
/// In general, the data supplied via the <see cref="GetPromptRequestParams.Arguments"/>'s dictionary is passed along from the caller and
/// should thus be considered unvalidated and untrusted. To provide validated and trusted data to the invocation of the prompt, consider having
/// should thus be considered unvalidated and untrusted. To provide validated and trusted data to the invocation of the prompt, consider having
/// the prompt be an instance method, referring to data stored in the instance, or using an instance or parameters resolved from the <see cref="IServiceProvider"/>
/// to provide data to the method.
/// </para>
@ -114,8 +114,8 @@ public sealed class McpServerPromptAttribute : Attribute
{
}
/// <summary>Gets the name of the prompt.</summary>
/// <remarks>If <see langword="null"/>, the method name will be used.</remarks>
/// <summary>Gets or sets the name of the prompt.</summary>
/// <remarks>If <see langword="null"/>, the method name is used.</remarks>
public string? Name { get; set; }
/// <summary>Gets or sets the title of the prompt.</summary>
@ -126,7 +126,7 @@ public sealed class McpServerPromptAttribute : Attribute
/// </summary>
/// <remarks>
/// <para>
/// This can be an HTTP/HTTPS URL pointing to an image file or a data URI with base64-encoded image data.
/// This value can be an HTTP/HTTPS URL pointing to an image file or a data URI with base64-encoded image data.
/// When specified, a single icon will be added to the prompt.
/// </para>
/// <para>

View file

@ -36,7 +36,7 @@ public sealed class McpServerPromptCreateOptions
/// </summary>
/// <remarks>
/// If <see langword="null"/>, but an <see cref="McpServerPromptAttribute"/> is applied to the method,
/// the name from the attribute will be used. If that's not present, a name based on the method's name will be used.
/// the name from the attribute is used. If that's not present, a name based on the method's name is used.
/// </remarks>
public string? Name { get; set; }
@ -50,7 +50,7 @@ public sealed class McpServerPromptCreateOptions
/// </summary>
/// <remarks>
/// If <see langword="null"/>, but a <see cref="DescriptionAttribute"/> is applied to the method,
/// the description from that attribute will be used.
/// the description from that attribute is used.
/// </remarks>
public string? Description { get; set; }
@ -63,7 +63,7 @@ public sealed class McpServerPromptCreateOptions
public JsonSerializerOptions? SerializerOptions { get; set; }
/// <summary>
/// Gets or sets the JSON schema options when creating <see cref="AIFunction"/> from a method.
/// Gets or sets the JSON schema options when creating an <see cref="AIFunction"/> from a method.
/// </summary>
/// <remarks>
/// Defaults to <see cref="AIJsonSchemaCreateOptions.Default"/> if left unspecified.
@ -83,7 +83,7 @@ public sealed class McpServerPromptCreateOptions
/// Gets or sets the icons for this prompt.
/// </summary>
/// <remarks>
/// This can be used by clients to display the prompt's icon in a user interface.
/// This property can be used by clients to display the prompt's icon in a user interface.
/// </remarks>
public IList<Icon>? Icons { get; set; }

View file

@ -1,12 +1,12 @@
namespace ModelContextProtocol.Server;
/// <summary>
/// Used to attribute a type containing methods that should be exposed as <see cref="McpServerPrompt"/>s.
/// Specifies that a type contains methods that should be exposed as <see cref="McpServerPrompt"/>s.
/// </summary>
/// <remarks>
/// <para>
/// This attribute is used to mark a class containing methods that should be automatically
/// discovered and registered as <see cref="McpServerPrompt"/>s. When combined with discovery methods like
/// discovered and registered as <see cref="McpServerPrompt"/> prompts. When combined with discovery methods like
/// WithPromptsFromAssembly, it enables automatic registration of prompts without explicitly listing each prompt class.
/// The attribute is not necessary when a reference to the type is provided directly to a method like WithPrompts.
/// </para>

View file

@ -25,8 +25,8 @@ namespace ModelContextProtocol.Server;
/// into the <see cref="ReadResourceResult"/> that's then serialized and sent back to the client.
/// </para>
/// <para>
/// <see cref="McpServerResource"/> is used to represent both direct resources (e.g. "resource://example") and templated
/// resources (e.g. "resource://example/{id}").
/// <see cref="McpServerResource"/> is used to represent both direct resources (for example,"resource://example") and templated
/// resources (for example,"resource://example/{id}").
/// </para>
/// <para>
/// Read resource requests do not contain separate arguments, only a URI. However, for templated resources, portions of that URI may be considered
@ -129,7 +129,7 @@ public abstract class McpServerResource : IMcpServerPrimitive
{
}
/// <summary>Gets whether this resource is a URI template with parameters as opposed to a direct resource.</summary>
/// <summary>Gets a value that indicates whether this resource is a URI template with parameters as opposed to a direct resource.</summary>
public bool IsTemplated => ProtocolResourceTemplate.UriTemplate.Contains('{');
/// <summary>Gets the protocol <see cref="ResourceTemplate"/> type for this instance.</summary>
@ -140,7 +140,7 @@ public abstract class McpServerResource : IMcpServerPrimitive
/// </para>
/// <para>
/// Every valid resource URI is a valid resource URI template, and thus this property always returns an instance.
/// In contrast, the <see cref="ProtocolResource"/> property may return <see langword="null"/> if the resource template
/// In contrast, the <see cref="ProtocolResource"/> property might return <see langword="null"/> if the resource template
/// contains a parameter, in which case the resource template URI is not a valid resource URI.
/// </para>
/// </remarks>
@ -224,12 +224,12 @@ public abstract class McpServerResource : IMcpServerPrimitive
/// <summary>
/// Creates an <see cref="McpServerResource"/> instance for a method, specified via an <see cref="MethodInfo"/> for
/// and instance method, along with a <see cref="Type"/> representing the type of the target object to
/// an instance method, along with a <see cref="Type"/> representing the type of the target object to
/// instantiate each time the method is invoked.
/// </summary>
/// <param name="method">The instance method to be represented via the created <see cref="AIFunction"/>.</param>
/// <param name="createTargetFunc">
/// Callback used on each function invocation to create an instance of the type on which the instance method <paramref name="method"/>
/// The callback used on each function invocation to create an instance of the type on which the instance method <paramref name="method"/>
/// will be invoked. If the returned instance is <see cref="IAsyncDisposable"/> or <see cref="IDisposable"/>, it will
/// be disposed of after method completes its invocation.
/// </param>

View file

@ -5,11 +5,11 @@ using ModelContextProtocol.Protocol;
namespace ModelContextProtocol.Server;
/// <summary>
/// Used to indicate that a method or property should be considered an <see cref="McpServerResource"/>.
/// Indicates that a method or property should be considered an <see cref="McpServerResource"/>.
/// </summary>
/// <remarks>
/// <para>
/// This attribute is applied to methods or properties that should be exposed as resources in the Model Context Protocol. When a class
/// This attribute is applied to methods or properties that should be exposed as resources in the Model Context Protocol. When a class
/// containing methods marked with this attribute is registered with McpServerBuilderExtensions,
/// these methods or properties become available as resources that can be called by MCP clients.
/// </para>
@ -50,15 +50,15 @@ namespace ModelContextProtocol.Server;
/// </item>
/// <item>
/// <description>
/// When the <see cref="McpServerResource"/> is constructed, it may be passed an <see cref="IServiceProvider"/> via
/// When the <see cref="McpServerResource"/> is constructed, it may be passed an <see cref="IServiceProvider"/> via
/// <see cref="McpServerResourceCreateOptions.Services"/>. Any parameter that can be satisfied by that <see cref="IServiceProvider"/>
/// according to <see cref="IServiceProviderIsService"/> will be resolved from the <see cref="IServiceProvider"/> provided to the
/// according to <see cref="IServiceProviderIsService"/> will be resolved from the <see cref="IServiceProvider"/> provided to the
/// resource invocation rather than from the argument collection.
/// </description>
/// </item>
/// <item>
/// <description>
/// Any parameter attributed with <see cref="FromKeyedServicesAttribute"/> will similarly be resolved from the
/// Any parameter attributed with <see cref="FromKeyedServicesAttribute"/> will similarly be resolved from the
/// <see cref="IServiceProvider"/> provided to the resource invocation rather than from the argument collection.
/// </description>
/// </item>
@ -119,15 +119,15 @@ public sealed class McpServerResourceAttribute : Attribute
/// <summary>Gets or sets the URI template of the resource.</summary>
/// <remarks>
/// If <see langword="null"/>, a URI will be derived from <see cref="Name"/> and the method's parameter names.
/// This template may, but doesn't have to, include parameters; if it does, this <see cref="McpServerResource"/>
/// will be considered a "resource template", and if it doesn't, it will be considered a "direct resource".
/// This template can, but doesn't have to, include parameters; if it does, this <see cref="McpServerResource"/>
/// is considered a "resource template", and if it doesn't, it is considered a "direct resource".
/// The former will be listed with <see cref="RequestMethods.ResourcesTemplatesList"/> requests and the latter
/// with <see cref="RequestMethods.ResourcesList"/> requests.
/// </remarks>
public string? UriTemplate { get; set; }
/// <summary>Gets or sets the name of the resource.</summary>
/// <remarks>If <see langword="null"/>, the method name will be used.</remarks>
/// <remarks>If <see langword="null"/>, the method name is used.</remarks>
public string? Name { get; set; }
/// <summary>Gets or sets the title of the resource.</summary>

View file

@ -36,7 +36,7 @@ public sealed class McpServerResourceCreateOptions
/// </summary>
/// <remarks>
/// If <see langword="null"/>, but an <see cref="McpServerResourceAttribute"/> is applied to the member,
/// the <see cref="McpServerResourceAttribute.UriTemplate"/> from the attribute will be used. If that's not present,
/// the <see cref="McpServerResourceAttribute.UriTemplate"/> from the attribute is used. If that's not present,
/// a URI template will be inferred from the member's signature.
/// </remarks>
public string? UriTemplate { get; set; }
@ -46,7 +46,7 @@ public sealed class McpServerResourceCreateOptions
/// </summary>
/// <remarks>
/// If <see langword="null"/>, but an <see cref="McpServerResourceAttribute"/> is applied to the member,
/// the name from the attribute will be used. If that's not present, a name based on the members's name will be used.
/// the name from the attribute is used. If that's not present, a name based on the members's name is used.
/// </remarks>
public string? Name { get; set; }
@ -60,7 +60,7 @@ public sealed class McpServerResourceCreateOptions
/// </summary>
/// <remarks>
/// If <see langword="null"/>, but a <see cref="DescriptionAttribute"/> is applied to the member,
/// the description from that attribute will be used.
/// the description from that attribute is used.
/// </remarks>
public string? Description { get; set; }
@ -72,17 +72,17 @@ public sealed class McpServerResourceCreateOptions
/// <summary>
/// Gets or sets the JSON serializer options to use when marshalling data to/from JSON.
/// </summary>
/// <remarks>
/// Defaults to <see cref="McpJsonUtilities.DefaultOptions"/> if left unspecified.
/// </remarks>
/// <value>
/// The default is <see cref="McpJsonUtilities.DefaultOptions"/>.
/// </value>
public JsonSerializerOptions? SerializerOptions { get; set; }
/// <summary>
/// Gets or sets the JSON schema options when creating <see cref="AIFunction"/> from a method.
/// </summary>
/// <remarks>
/// Defaults to <see cref="AIJsonSchemaCreateOptions.Default"/> if left unspecified.
/// </remarks>
/// <value>
/// The default is <see cref="AIJsonSchemaCreateOptions.Default"/>.
/// </value>
public AIJsonSchemaCreateOptions? SchemaCreateOptions { get; set; }
/// <summary>
@ -98,7 +98,7 @@ public sealed class McpServerResourceCreateOptions
/// Gets or sets the icons for this resource.
/// </summary>
/// <remarks>
/// This can be used by clients to display the resource's icon in a user interface.
/// This property can be used by clients to display the resource's icon in a user interface.
/// </remarks>
public IList<Icon>? Icons { get; set; }
@ -109,7 +109,7 @@ public sealed class McpServerResourceCreateOptions
/// <para>
/// This <see cref="JsonObject"/> is used to seed the <see cref="Resource.Meta"/> property. Any metadata from
/// <see cref="McpMetaAttribute"/> instances on the method will be added to this object, but
/// properties already present in this <see cref="JsonObject"/> will not be overwritten.
/// properties already present in this <see cref="JsonObject"/> are not overwritten.
/// </para>
/// <para>
/// Implementations must not make assumptions about its contents.

View file

@ -1,13 +1,13 @@
namespace ModelContextProtocol.Server;
/// <summary>
/// Used to attribute a type containing members that should be exposed as <see cref="McpServerResource"/>s.
/// Indicates that a type contains members that should be exposed as <see cref="McpServerResource"/>s.
/// </summary>
/// <remarks>
/// <para>
/// This attribute is used to mark a class containing members that should be automatically
/// discovered and registered as <see cref="McpServerResource"/>s. When combined with discovery methods like
/// WithResourcesFromAssembly, it enables automatic registration of resources without explicitly listing each
/// WithResourcesFromAssembly, it enables automatic registration of resources without explicitly listing each
/// resource class. The attribute is not necessary when a reference to the type is provided directly to a method
/// like McpServerBuilderExtensions.WithResources.
/// </para>

View file

@ -184,7 +184,7 @@ public abstract class McpServerTool : IMcpServerPrimitive
/// <summary>
/// Creates an <see cref="McpServerTool"/> instance for a method, specified via an <see cref="MethodInfo"/> for
/// and instance method, along with a <see cref="Type"/> representing the type of the target object to
/// an instance method, along with a <see cref="Type"/> representing the type of the target object to
/// instantiate each time the method is invoked.
/// </summary>
/// <param name="method">The instance method to be represented via the created <see cref="AIFunction"/>.</param>

View file

@ -6,11 +6,11 @@ using System.Text.Json;
namespace ModelContextProtocol.Server;
/// <summary>
/// Used to indicate that a method should be considered an <see cref="McpServerTool"/>.
/// Indicates that a method should be considered an <see cref="McpServerTool"/>.
/// </summary>
/// <remarks>
/// <para>
/// This attribute is applied to methods that should be exposed as tools in the Model Context Protocol. When a class
/// This attribute is applied to methods that should be exposed as tools in the Model Context Protocol. When a class
/// containing methods marked with this attribute is registered with McpServerBuilderExtensions,
/// these methods become available as tools that can be called by MCP clients.
/// </para>
@ -47,22 +47,22 @@ namespace ModelContextProtocol.Server;
/// <description>
/// <see cref="IProgress{ProgressNotificationValue}"/> parameters accepting <see cref="ProgressNotificationValue"/> values
/// are not included in the JSON schema and are bound to an <see cref="IProgress{ProgressNotificationValue}"/> instance manufactured
/// to forward progress notifications from the tool to the client. If the client included a <see cref="ProgressToken"/> in their request,
/// to forward progress notifications from the tool to the client. If the client included a <see cref="ProgressToken"/> in their request,
/// progress reports issued to this instance will propagate to the client as <see cref="NotificationMethods.ProgressNotification"/> notifications with
/// that token. If the client did not include a <see cref="ProgressToken"/>, the instance will ignore any progress reports issued to it.
/// </description>
/// </item>
/// <item>
/// <description>
/// When the <see cref="McpServerTool"/> is constructed, it may be passed an <see cref="IServiceProvider"/> via
/// When the <see cref="McpServerTool"/> is constructed, it may be passed an <see cref="IServiceProvider"/> via
/// <see cref="McpServerToolCreateOptions.Services"/>. Any parameter that can be satisfied by that <see cref="IServiceProvider"/>
/// according to <see cref="IServiceProviderIsService"/> will not be included in the generated JSON schema and will be resolved
/// according to <see cref="IServiceProviderIsService"/> will not be included in the generated JSON schema and will be resolved
/// from the <see cref="IServiceProvider"/> provided to when the tool is invoked rather than from the argument collection.
/// </description>
/// </item>
/// <item>
/// <description>
/// Any parameter attributed with <see cref="FromKeyedServicesAttribute"/> will similarly be resolved from the
/// Any parameter attributed with <see cref="FromKeyedServicesAttribute"/> will similarly be resolved from the
/// <see cref="IServiceProvider"/> provided when the tool is invoked rather than from the argument
/// collection, and will not be included in the generated JSON schema.
/// </description>
@ -70,13 +70,13 @@ namespace ModelContextProtocol.Server;
/// </list>
/// </para>
/// <para>
/// All other parameters are deserialized from the <see cref="JsonElement"/>s in the <see cref="CallToolRequestParams.Arguments"/> dictionary,
/// using the <see cref="JsonSerializerOptions"/> supplied in <see cref="McpServerToolCreateOptions.SerializerOptions"/>, or if none was provided,
/// All other parameters are deserialized from the <see cref="JsonElement"/>s in the <see cref="CallToolRequestParams.Arguments"/> dictionary,
/// using the <see cref="JsonSerializerOptions"/> supplied in <see cref="McpServerToolCreateOptions.SerializerOptions"/>, or if none was provided,
/// using <see cref="McpJsonUtilities.DefaultOptions"/>.
/// </para>
/// <para>
/// In general, the data supplied via the <see cref="CallToolRequestParams.Arguments"/>'s dictionary is passed along from the caller and
/// should thus be considered unvalidated and untrusted. To provide validated and trusted data to the invocation of the tool, consider having
/// should thus be considered unvalidated and untrusted. To provide validated and trusted data to the invocation of the tool, consider having
/// the tool be an instance method, referring to data stored in the instance, or using an instance or parameters resolved from the <see cref="IServiceProvider"/>
/// to provide data to the method.
/// </para>
@ -145,7 +145,7 @@ public sealed class McpServerToolAttribute : Attribute
}
/// <summary>Gets the name of the tool.</summary>
/// <remarks>If <see langword="null"/>, the method name will be used.</remarks>
/// <remarks>If <see langword="null"/>, the method name is used.</remarks>
public string? Name { get; set; }
/// <summary>
@ -165,93 +165,81 @@ public sealed class McpServerToolAttribute : Attribute
public string? Title { get; set; }
/// <summary>
/// Gets or sets whether the tool may perform destructive updates to its environment.
/// Gets or sets a value that indicates whether the tool might perform destructive updates to its environment.
/// </summary>
/// <remarks>
/// <para>
/// If <see langword="true"/>, the tool may perform destructive updates to its environment.
/// If <see langword="false"/>, the tool performs only additive updates.
/// This property is most relevant when the tool modifies its environment (ReadOnly = false).
/// </para>
/// <para>
/// <value>
/// <see langword="true"/> if the tool might perform destructive updates to its environment.
/// <see langword="false"/> if the tool performs only additive updates.
/// The default is <see langword="true"/>.
/// </para>
/// </value>
/// <remarks>
/// This property is most relevant when the tool modifies its environment (ReadOnly = false).
/// </remarks>
public bool Destructive
public bool Destructive
{
get => _destructive ?? DestructiveDefault;
set => _destructive = value;
get => _destructive ?? DestructiveDefault;
set => _destructive = value;
}
/// <summary>
/// Gets or sets whether calling the tool repeatedly with the same arguments
/// will have no additional effect on its environment.
/// Gets or sets a value that indicates whether calling the tool repeatedly with the same arguments
/// has no additional effect on its environment.
/// </summary>
/// <remarks>
/// <para>
/// This property is most relevant when the tool modifies its environment (ReadOnly = false).
/// </para>
/// <para>
/// <value>
/// <see langword="true"/> if calling the tool repeatedly with the same arguments
/// has no additional effect on the environment; <see langword="false"/> if it does.
/// The default is <see langword="false"/>.
/// </para>
/// </value>
/// <remarks>
/// This property is most relevant when the tool modifies its environment (ReadOnly = false).
/// </remarks>
public bool Idempotent
public bool Idempotent
{
get => _idempotent ?? IdempotentDefault;
set => _idempotent = value;
set => _idempotent = value;
}
/// <summary>
/// Gets or sets whether this tool may interact with an "open world" of external entities.
/// Gets or sets a value that indicates whether this tool can interact with an "open world" of external entities.
/// </summary>
/// <remarks>
/// <para>
/// If <see langword="true"/>, the tool may interact with an unpredictable or dynamic set of entities (like web search).
/// If <see langword="false"/>, the tool's domain of interaction is closed and well-defined (like memory access).
/// </para>
/// <para>
/// <value>
/// <see langword="true"/> if the tool can interact with an unpredictable or dynamic set of entities (like web search).
/// <see langword="false"/> if the tool's domain of interaction is closed and well-defined (like memory access).
/// The default is <see langword="true"/>.
/// </para>
/// </remarks>
/// </value>
public bool OpenWorld
{
get => _openWorld ?? OpenWorldDefault;
set => _openWorld = value;
get => _openWorld ?? OpenWorldDefault;
set => _openWorld = value;
}
/// <summary>
/// Gets or sets whether this tool does not modify its environment.
/// Gets or sets a value that indicates whether this tool does not modify its environment.
/// </summary>
/// <value>
/// <see langword="true"/> if the tool only performs read operations without changing state.
/// <see langword="false"/> if the tool might make modifications to its environment.
/// The default is <see langword="false"/>.
/// </value>
/// <remarks>
/// <para>
/// If <see langword="true"/>, the tool only performs read operations without changing state.
/// If <see langword="false"/>, the tool may make modifications to its environment.
/// </para>
/// <para>
/// Read-only tools do not have side effects beyond computational resource usage.
/// They don't create, update, or delete data in any system.
/// </para>
/// <para>
/// The default is <see langword="false"/>.
/// </para>
/// </remarks>
public bool ReadOnly
public bool ReadOnly
{
get => _readOnly ?? ReadOnlyDefault;
set => _readOnly = value;
get => _readOnly ?? ReadOnlyDefault;
set => _readOnly = value;
}
/// <summary>
/// Gets or sets whether the tool should report an output schema for structured content.
/// Gets or sets a value that indicates whether the tool should report an output schema for structured content.
/// </summary>
/// <value>
/// The default is <see langword="false"/>.
/// </value>
/// <remarks>
/// <para>
/// When enabled, the tool will attempt to populate the <see cref="Tool.OutputSchema"/>
/// and provide structured content in the <see cref="CallToolResult.StructuredContent"/> property.
/// </para>
/// <para>
/// The default is <see langword="false"/>.
/// </para>
/// </remarks>
public bool UseStructuredContent { get; set; }
@ -260,7 +248,7 @@ public sealed class McpServerToolAttribute : Attribute
/// </summary>
/// <remarks>
/// <para>
/// This can be an HTTP/HTTPS URL pointing to an image file or a data URI with base64-encoded image data.
/// This value can be an HTTP/HTTPS URL pointing to an image file or a data URI with base64-encoded image data.
/// When specified, a single icon will be added to the tool.
/// </para>
/// <para>

View file

@ -36,7 +36,7 @@ public sealed class McpServerToolCreateOptions
/// </summary>
/// <remarks>
/// If <see langword="null"/>, but an <see cref="McpServerToolAttribute"/> is applied to the method,
/// the name from the attribute will be used. If that's not present, a name based on the method's name will be used.
/// the name from the attribute is used. If that's not present, a name based on the method's name is used.
/// </remarks>
public string? Name { get; set; }
@ -45,7 +45,7 @@ public sealed class McpServerToolCreateOptions
/// </summary>
/// <remarks>
/// If <see langword="null"/>, but a <see cref="DescriptionAttribute"/> is applied to the method,
/// the description from that attribute will be used.
/// the description from that attribute is used.
/// </remarks>
public string? Description { get; set; }
@ -66,94 +66,82 @@ public sealed class McpServerToolCreateOptions
public string? Title { get; set; }
/// <summary>
/// Gets or sets whether the tool may perform destructive updates to its environment.
/// Gets or sets a value that indicates whether the tool might perform destructive updates to its environment.
/// </summary>
/// <remarks>
/// <para>
/// If <see langword="true"/>, the tool may perform destructive updates to its environment.
/// If <see langword="false"/>, the tool performs only additive updates.
/// This property is most relevant when the tool modifies its environment (ReadOnly = false).
/// </para>
/// <para>
/// <value>
/// <see langword="true"/> if the tool might perform destructive updates to its environment.
/// <see langword="false"/> if the tool performs only additive updates.
/// The default is <see langword="true"/>.
/// </para>
/// </value>
/// <remarks>
/// This property is most relevant when the tool modifies its environment (ReadOnly = false).
/// </remarks>
public bool? Destructive { get; set; }
/// <summary>
/// Gets or sets whether calling the tool repeatedly with the same arguments
/// will have no additional effect on its environment.
/// Gets or sets a value that indicates whether calling the tool repeatedly with the same arguments
/// has no additional effect on its environment.
/// </summary>
/// <remarks>
/// <para>
/// This property is most relevant when the tool modifies its environment (ReadOnly = false).
/// </para>
/// <para>
/// <value>
/// <see langword="true"/> if calling the tool repeatedly with the same arguments
/// has no additional effect on the environment; <see langword="false"/> if it does.
/// The default is <see langword="false"/>.
/// </para>
/// </value>
/// <remarks>
/// This property is most relevant when the tool modifies its environment (ReadOnly = false).
/// </remarks>
public bool? Idempotent { get; set; }
/// <summary>
/// Gets or sets whether this tool may interact with an "open world" of external entities.
/// Gets or sets a value that indicates whether this tool can interact with an "open world" of external entities.
/// </summary>
/// <remarks>
/// <para>
/// If <see langword="true"/>, the tool may interact with an unpredictable or dynamic set of entities (like web search).
/// If <see langword="false"/>, the tool's domain of interaction is closed and well-defined (like memory access).
/// </para>
/// <para>
/// <value>
/// <see langword="true"/> if the tool can interact with an unpredictable or dynamic set of entities (like web search).
/// <see langword="false"/> if the tool's domain of interaction is closed and well-defined (like memory access).
/// The default is <see langword="true"/>.
/// </para>
/// </remarks>
/// </value>
public bool? OpenWorld { get; set; }
/// <summary>
/// Gets or sets whether this tool does not modify its environment.
/// Gets or sets a value that indicates whether this tool does not modify its environment.
/// </summary>
/// <remarks>
/// <para>
/// <value>
/// If <see langword="true"/>, the tool only performs read operations without changing state.
/// If <see langword="false"/>, the tool may make modifications to its environment.
/// </para>
/// <para>
/// If <see langword="false"/>, the tool might make modifications to its environment.
/// The default is <see langword="false"/>.
/// </value>
/// <remarks>
/// Read-only tools do not have side effects beyond computational resource usage.
/// They don't create, update, or delete data in any system.
/// </para>
/// <para>
/// The default is <see langword="false"/>.
/// </para>
/// </remarks>
public bool? ReadOnly { get; set; }
/// <summary>
/// Gets or sets whether the tool should report an output schema for structured content.
/// Gets or sets a value that indicates whether the tool should report an output schema for structured content.
/// </summary>
/// <value>
/// The default is <see langword="false"/>.
/// </value>
/// <remarks>
/// <para>
/// When enabled, the tool will attempt to populate the <see cref="Tool.OutputSchema"/>
/// and provide structured content in the <see cref="CallToolResult.StructuredContent"/> property.
/// </para>
/// <para>
/// The default is <see langword="false"/>.
/// </para>
/// </remarks>
public bool UseStructuredContent { get; set; }
/// <summary>
/// Gets or sets the JSON serializer options to use when marshalling data to/from JSON.
/// </summary>
/// <remarks>
/// Defaults to <see cref="McpJsonUtilities.DefaultOptions"/> if left unspecified.
/// </remarks>
/// <value>
/// The default is <see cref="McpJsonUtilities.DefaultOptions"/>.
/// </value>
public JsonSerializerOptions? SerializerOptions { get; set; }
/// <summary>
/// Gets or sets the JSON schema options when creating <see cref="AIFunction"/> from a method.
/// Gets or sets the JSON schema options when creating an <see cref="AIFunction"/> from a method.
/// </summary>
/// <remarks>
/// Defaults to <see cref="AIJsonSchemaCreateOptions.Default"/> if left unspecified.
/// </remarks>
/// <value>
/// The default is <see cref="AIJsonSchemaCreateOptions.Default"/>.
/// </value>
public AIJsonSchemaCreateOptions? SchemaCreateOptions { get; set; }
/// <summary>
@ -169,7 +157,7 @@ public sealed class McpServerToolCreateOptions
/// Gets or sets the icons for this tool.
/// </summary>
/// <remarks>
/// This can be used by clients to display the tool's icon in a user interface.
/// This property can be used by clients to display the tool's icon in a user interface.
/// </remarks>
public IList<Icon>? Icons { get; set; }

View file

@ -1,7 +1,7 @@
namespace ModelContextProtocol.Server;
/// <summary>
/// Used to attribute a type containing methods that should be exposed as <see cref="McpServerTool"/>s.
/// Indicates that a type contains methods that should be exposed as <see cref="McpServerTool"/>s.
/// </summary>
/// <remarks>
/// <para>

View file

@ -10,7 +10,7 @@ namespace ModelContextProtocol.Server;
/// <remarks>
/// The <see cref="RequestContext{TParams}"/> encapsulates all contextual information for handling an MCP request.
/// This type is typically received as a parameter in handler delegates registered with IMcpServerBuilder,
/// and may be injected as parameters into <see cref="McpServerTool"/>s.
/// and can be injected as parameters into <see cref="McpServerTool"/>s.
/// </remarks>
public sealed class RequestContext<TParams>
{
@ -55,7 +55,7 @@ public sealed class RequestContext<TParams>
/// <summary>Gets or sets the services associated with this request.</summary>
/// <remarks>
/// This may not be the same instance stored in <see cref="McpServer.Services"/>
/// This provider might not be the same instance stored in <see cref="McpServer.Services"/>
/// if <see cref="McpServerOptions.ScopeRequests"/> was true, in which case this
/// might be a scoped <see cref="IServiceProvider"/> derived from the server's
/// <see cref="McpServer.Services"/>.
@ -81,4 +81,4 @@ public sealed class RequestContext<TParams>
/// including the method name, parameters, request ID, and associated transport and user information.
/// </remarks>
public JsonRpcRequest JsonRpcRequest { get; }
}
}

View file

@ -76,7 +76,7 @@ public sealed class SseResponseStreamTransport(Stream sseResponseStream, string?
/// <param name="message">The JSON-RPC message received from the client.</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 asynchronous operation to buffer the JSON-RPC message for processing.</returns>
/// <exception cref="InvalidOperationException">Thrown when there is an attempt to process a message before calling <see cref="RunAsync(CancellationToken)"/>.</exception>
/// <exception cref="InvalidOperationException">There is an attempt to process a message before calling <see cref="RunAsync(CancellationToken)"/>.</exception>
/// <remarks>
/// <para>
/// This method is the entry point for processing client-to-server communication in the SSE transport model.

View file

@ -36,8 +36,7 @@ public class StreamServerTransport : TransportBase
/// <param name="outputStream">The output <see cref="Stream"/> to use as standard output.</param>
/// <param name="serverName">Optional name of the server, used for diagnostic purposes, like logging.</param>
/// <param name="loggerFactory">Optional logger factory used for logging employed by the transport.</param>
/// <exception cref="ArgumentNullException"><paramref name="inputStream"/> is <see langword="null"/>.</exception>
/// <exception cref="ArgumentNullException"><paramref name="outputStream"/> is <see langword="null"/>.</exception>
/// <exception cref="ArgumentNullException"><paramref name="inputStream"/> or <paramref name="outputStream"/> is <see langword="null"/>.</exception>
public StreamServerTransport(Stream inputStream, Stream outputStream, string? serverName = null, ILoggerFactory? loggerFactory = null)
: base(serverName is not null ? $"Server (stream) ({serverName})" : "Server (stream)", loggerFactory)
{

Some files were not shown because too many files have changed in this diff Show more