Class
McpProvider
Represents a server that hosts a Model Context Protocol server.
public sealed class McpProviderInheritance #
Inherited Members #
object.GetType(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
Constructors #
| Name | Description |
|---|---|
| McpProvider() | Creates a new instance of the McpProvider class. |
| McpProvider(string, string, Version) | Creates a new instance of the McpProvider class with the specified server details. |
Fields #
| Name | Description |
|---|---|
| HEADER_MISMATCH_ERROR | Represents the error code for missing or mismatched HTTP metadata headers. |
| MISSING_REQUIRED_CLIENT_CAPABILITY_ERROR | Represents the error code for a required client capability that was not declared. |
| PROTOCOL_VERSION | Represents the current supported version of the Model Context Protocol. |
| UNSUPPORTED_PROTOCOL_VERSION_ERROR | Represents the error code for a protocol version that the provider does not support. |
Properties #
| Name | Description |
|---|---|
| ClientInstructions | Gets or sets instructions that help clients understand how to use the server. |
| Icons | Gets or sets the icons that clients can display for the server. |
| OriginValidator | Gets or sets a validator for explicitly trusted origins. |
| ServerDescription | Gets or sets a human-readable description of the server. |
| ServerName | Gets or sets the internal name of the server. |
| ServerTitle | Gets or sets the display name of the server. |
| ServerVersion | Gets or sets the version of the MCP server. |
| ServerWebsiteUrl | Gets or sets the URL of the server website. |
| Skills | Gets or sets the skills hosted by this server. Register skills before handling requests. |
| SupportedProtocolVersions | Gets the stateless protocol versions accepted by this provider. |
| Tools | Gets or sets the list of MCP tools hosted by this server. |
Methods #
| Name | Description |
|---|---|
| HandleRequestAsync(HttpRequest, CancellationToken) | Handles an incoming HTTP request for MCP operations asynchronously. |