Class McpServerResourceCreateOptions
- Namespace
- ModelContextProtocol.Server
- Assembly
- ModelContextProtocol.Core.dll
Provides options for controlling the creation of an McpServerResource.
public sealed class McpServerResourceCreateOptions
- Inheritance
-
McpServerResourceCreateOptions
- Inherited Members
Remarks
These options allow for customizing the behavior and metadata of resources created with McpServerResource.Create. They provide control over naming, description, and dependency injection integration.
When creating resources programmatically rather than using attributes, these options provide the same level of configuration flexibility.
Properties
Description
Gets or set the description to use for the McpServerResource.
public string? Description { get; set; }
Property Value
Remarks
If null, but a DescriptionAttribute is applied to the member, the description from that attribute will be used.
MimeType
Gets or sets the MIME (media) type of the McpServerResource.
public string? MimeType { get; set; }
Property Value
Name
Gets or sets the name to use for the McpServerResource.
public string? Name { get; set; }
Property Value
Remarks
If null, but an 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.
Services
Gets or sets optional services used in the construction of the McpServerResource.
public IServiceProvider? Services { get; set; }
Property Value
Remarks
These services will be used to determine which parameters should be satisifed from dependency injection. As such, what services are satisfied via this provider should match what's satisfied via the provider passed in at invocation time.
UriTemplate
Gets or sets the URI template of the McpServerResource.
public string? UriTemplate { get; set; }
Property Value
Remarks
If null, but an McpServerResourceAttribute is applied to the member, the UriTemplate from the attribute will be used. If that's not present, a URI template will be inferred from the member's signature.