ReplMcpServerOptions
Configuration for the Repl MCP server integration.
- Kind:
Class - Namespace: Repl.Mcp
- Assembly:
Repl.Mcp - Source: src/Repl.Mcp/ReplMcpServerOptions.cs
Signature
Section titled “Signature”public sealed class ReplMcpServerOptionsInheritance
Section titled “Inheritance”Methods
Section titled “Methods”Prompt(string, Delegate)
Section titled “Prompt(string, Delegate)”Registers an MCP prompt with a DI-injectable handler.
public ReplMcpServerOptions Prompt(string name, Delegate handler)Parameters
Section titled “Parameters”Returns
Section titled “Returns”ReplMcpServerOptions - The same options instance.
UiResource(string, Delegate, Action<McpAppResourceOptions>?)
Section titled “UiResource(string, Delegate, Action<McpAppResourceOptions>?)”Registers an MCP App HTML resource with a DI-injectable handler.
public ReplMcpServerOptions UiResource(string uri, Delegate handler, Action<McpAppResourceOptions>? configure = null)Parameters
Section titled “Parameters”uri(string): Theui://resource URI.handler(Delegate): Handler returning a complete HTML document. Parameters are resolved from services or the MCP App resource context.configure(Action<McpAppResourceOptions>): Optional resource metadata configuration.
Returns
Section titled “Returns”ReplMcpServerOptions - The same options instance.
UiResource(string, Func<McpAppResourceContext, CancellationToken, ValueTask<string>>, Action<McpAppResourceOptions>?)
Section titled “UiResource(string, Func<McpAppResourceContext, CancellationToken, ValueTask<string>>, Action<McpAppResourceOptions>?)”Registers an MCP App HTML resource.
public ReplMcpServerOptions UiResource(string uri, Func<McpAppResourceContext, CancellationToken, ValueTask<string>> htmlFactory, Action<McpAppResourceOptions>? configure = null)Parameters
Section titled “Parameters”uri(string): Theui://resource URI.htmlFactory(Func<McpAppResourceContext, CancellationToken, ValueTask<string>>): Factory returning a complete HTML document. Parameters are resolved from services or the MCP App resource context.configure(Action<McpAppResourceOptions>): Optional resource metadata configuration.
Returns
Section titled “Returns”ReplMcpServerOptions - The same options instance.
UiResource(string, Func<string>, Action<McpAppResourceOptions>?)
Section titled “UiResource(string, Func<string>, Action<McpAppResourceOptions>?)”Registers an MCP App HTML resource.
public ReplMcpServerOptions UiResource(string uri, Func<string> htmlFactory, Action<McpAppResourceOptions>? configure = null)Parameters
Section titled “Parameters”uri(string): Theui://resource URI.htmlFactory(Func<string>): Factory returning a complete HTML document. Parameters are resolved from services or the MCP App resource context.configure(Action<McpAppResourceOptions>): Optional resource metadata configuration.
Returns
Section titled “Returns”ReplMcpServerOptions - The same options instance.
UiResource(string, Func<CancellationToken, ValueTask<string>>, Action<McpAppResourceOptions>?)
Section titled “UiResource(string, Func<CancellationToken, ValueTask<string>>, Action<McpAppResourceOptions>?)”Registers an MCP App HTML resource.
public ReplMcpServerOptions UiResource(string uri, Func<CancellationToken, ValueTask<string>> htmlFactory, Action<McpAppResourceOptions>? configure = null)Parameters
Section titled “Parameters”uri(string): Theui://resource URI.htmlFactory(Func<CancellationToken, ValueTask<string>>): Factory returning a complete HTML document. Parameters are resolved from services or the MCP App resource context.configure(Action<McpAppResourceOptions>): Optional resource metadata configuration.
Returns
Section titled “Returns”ReplMcpServerOptions - The same options instance.
UiResource(string, string, Action<McpAppResourceOptions>?)
Section titled “UiResource(string, string, Action<McpAppResourceOptions>?)”Registers a static MCP App HTML resource.
public ReplMcpServerOptions UiResource(string uri, string html, Action<McpAppResourceOptions>? configure = null)Parameters
Section titled “Parameters”uri(string): Theui://resource URI.html(string): Complete HTML document returned for the resource.configure(Action<McpAppResourceOptions>): Optional resource metadata configuration.
Returns
Section titled “Returns”ReplMcpServerOptions - The same options instance.
UiResource<TService>(string, Func<TService, string>, Action<McpAppResourceOptions>?)
Section titled “UiResource<TService>(string, Func<TService, string>, Action<McpAppResourceOptions>?)”Registers an MCP App HTML resource with a single DI-injected service parameter.
public ReplMcpServerOptions UiResource<TService>(string uri, Func<TService, string> htmlFactory, Action<McpAppResourceOptions>? configure = null)Type Parameters
Section titled “Type Parameters”TService: Service type resolved from the Repl app service provider.
Parameters
Section titled “Parameters”uri(string): Theui://resource URI.htmlFactory(Func<TService, string>): Factory returning a complete HTML document.configure(Action<McpAppResourceOptions>): Optional resource metadata configuration.
Returns
Section titled “Returns”ReplMcpServerOptions - The same options instance.
UiResource<TService>(string, Func<TService, Task<string>>, Action<McpAppResourceOptions>?)
Section titled “UiResource<TService>(string, Func<TService, Task<string>>, Action<McpAppResourceOptions>?)”Registers an MCP App HTML resource with a single DI-injected service parameter.
public ReplMcpServerOptions UiResource<TService>(string uri, Func<TService, Task<string>> htmlFactory, Action<McpAppResourceOptions>? configure = null)Type Parameters
Section titled “Type Parameters”TService: Service type resolved from the Repl app service provider.
Parameters
Section titled “Parameters”uri(string): Theui://resource URI.htmlFactory(Func<TService, Task<string>>): Factory returning a complete HTML document.configure(Action<McpAppResourceOptions>): Optional resource metadata configuration.
Returns
Section titled “Returns”ReplMcpServerOptions - The same options instance.
UiResource<TService>(string, Func<TService, ValueTask<string>>, Action<McpAppResourceOptions>?)
Section titled “UiResource<TService>(string, Func<TService, ValueTask<string>>, Action<McpAppResourceOptions>?)”Registers an MCP App HTML resource with a single DI-injected service parameter.
public ReplMcpServerOptions UiResource<TService>(string uri, Func<TService, ValueTask<string>> htmlFactory, Action<McpAppResourceOptions>? configure = null)Type Parameters
Section titled “Type Parameters”TService: Service type resolved from the Repl app service provider.
Parameters
Section titled “Parameters”uri(string): Theui://resource URI.htmlFactory(Func<TService, ValueTask<string>>): Factory returning a complete HTML document.configure(Action<McpAppResourceOptions>): Optional resource metadata configuration.
Returns
Section titled “Returns”ReplMcpServerOptions - The same options instance.
Properties
Section titled “Properties”AutoPromoteReadOnlyToResources
Section titled “AutoPromoteReadOnlyToResources”When true (default), commands annotated .ReadOnly() are automatically
exposed as MCP resources in addition to being tools.
Set to false to require explicit .AsResource() marking.
public bool AutoPromoteReadOnlyToResources { get; set; }Returns
Section titled “Returns”CommandFilter
Section titled “CommandFilter”Optional filter controlling which commands are exposed as MCP tools.
When null, all non-hidden, non-AutomationHidden commands are exposed.
public Func<ReplDocCommand, bool>? CommandFilter { get; set; }Returns
Section titled “Returns”Func<ReplDocCommand, bool>
ContextName
Section titled “ContextName”Context name for the MCP subcommands (default: "mcp").
The serve subcommand becomes: myapp {ContextName} serve.
public string ContextName { get; set; }Returns
Section titled “Returns”DynamicToolCompatibility
Section titled “DynamicToolCompatibility”Controls the opt-in compatibility layer for clients that don’t handle dynamic MCP tool lists well. Leave this disabled for applications whose tool list is static.
public DynamicToolCompatibilityMode DynamicToolCompatibility { get; set; }Returns
Section titled “Returns”EnableApps
Section titled “EnableApps”When true, the server advertises the MCP Apps UI extension.
Mapped MCP App resources and UiResource(string, string, Action<McpAppResourceOptions>) registrations
enable this automatically.
public bool EnableApps { get; set; }Returns
Section titled “Returns”InteractivityMode
Section titled “InteractivityMode”Controls how runtime interaction prompts are handled in MCP mode.
public InteractivityMode InteractivityMode { get; set; }Returns
Section titled “Returns”PagedResultTextMode
Section titled “PagedResultTextMode”Controls the text fallback emitted alongside structured paged tool results.
public McpPagedResultTextMode PagedResultTextMode { get; set; }Returns
Section titled “Returns”PromptFallbackToTools
Section titled “PromptFallbackToTools”When true, prompts are also exposed as tools.
This is a compatibility fallback for clients that don’t support MCP prompts (~62% as of March 2025).
Default is false — opt in when your target agents lack prompt support.
public bool PromptFallbackToTools { get; set; }Returns
Section titled “Returns”ResourceFallbackToTools
Section titled “ResourceFallbackToTools”When true, resources are also exposed as read-only tools.
This is a compatibility fallback for clients that don’t support MCP resources (~61% as of March 2025).
Default is false — opt in when your target agents lack resource support.
public bool ResourceFallbackToTools { get; set; }Returns
Section titled “Returns”ResourceUriScheme
Section titled “ResourceUriScheme”URI scheme used for MCP resource URIs (default: "repl").
Resources are exposed as {scheme}://{path}.
public string ResourceUriScheme { get; set; }Returns
Section titled “Returns”ServerName
Section titled “ServerName”Server name reported in the MCP initialize response.
Defaults to the assembly product name.
public string? ServerName { get; set; }Returns
Section titled “Returns”ServerVersion
Section titled “ServerVersion”Server version reported in the MCP initialize response.
public string? ServerVersion { get; set; }Returns
Section titled “Returns”ToolNamingSeparator
Section titled “ToolNamingSeparator”Separator used when flattening context paths into MCP tool names.
public ToolNamingSeparator ToolNamingSeparator { get; set; }Returns
Section titled “Returns”TransportFactory
Section titled “TransportFactory”Optional factory for creating custom MCP transports (e.g. WebSocket, SSE).
When null (default), the server uses StdioServerTransport.
The factory receives the server name and the I/O context for stream access.
public Func<string, IReplIoContext, ITransport>? TransportFactory { get; set; }Returns
Section titled “Returns”Func<string, IReplIoContext, ITransport>