Table of Contents

Interface IMcpElicitation

Namespace
Repl.Mcp
Assembly
Repl.Mcp.dll

Provides direct access to MCP elicitation (structured user input) from the connected client. Inject this interface into command handlers to request user input outside the IReplInteractionChannel abstraction.

public interface IMcpElicitation

Remarks

Each method maps to a single-field MCP elicitation request. Returns null when the client does not support elicitation or the user cancels the request.

Future: Multi-field elicitation (e.g., a form with several inputs at once) may be added via a builder pattern or a richer interface. If you need this capability, please open a feature request on the Repl repository.

Properties

IsSupported

Gets a value indicating whether the connected MCP client supports elicitation.

bool IsSupported { get; }

Property Value

bool

Methods

ElicitBooleanAsync(string, CancellationToken)

Asks the user for a boolean (yes/no) value. Returns null when elicitation is not supported or the user cancels.

ValueTask<bool?> ElicitBooleanAsync(string message, CancellationToken cancellationToken = default)

Parameters

message string

The prompt message shown to the user.

cancellationToken CancellationToken

Cancellation token.

Returns

ValueTask<bool?>

ElicitChoiceAsync(string, IReadOnlyList<string>, CancellationToken)

Asks the user to pick one value from a list of choices. Returns the zero-based index of the selected choice, or null when elicitation is not supported, the user cancels, or the response does not match any choice.

ValueTask<int?> ElicitChoiceAsync(string message, IReadOnlyList<string> choices, CancellationToken cancellationToken = default)

Parameters

message string

The prompt message shown to the user.

choices IReadOnlyList<string>

The available options.

cancellationToken CancellationToken

Cancellation token.

Returns

ValueTask<int?>

ElicitNumberAsync(string, CancellationToken)

Asks the user for a numeric value. Returns null when elicitation is not supported or the user cancels.

ValueTask<double?> ElicitNumberAsync(string message, CancellationToken cancellationToken = default)

Parameters

message string

The prompt message shown to the user.

cancellationToken CancellationToken

Cancellation token.

Returns

ValueTask<double?>

ElicitTextAsync(string, CancellationToken)

Asks the user for a free-text value. Returns null when elicitation is not supported or the user cancels.

ValueTask<string?> ElicitTextAsync(string message, CancellationToken cancellationToken = default)

Parameters

message string

The prompt message shown to the user.

cancellationToken CancellationToken

Cancellation token.

Returns

ValueTask<string>