Conversational elicitation of strongly-typed Rust values via MCP.
The elicitation library provides a trait-based system for eliciting
strongly-typed values from users through conversational interaction via
the Model Context Protocol (MCP). It transforms LLM conversations into
type-safe Rust values with compile-time guarantees.
MCP Setup Required
This library runs as an MCP server and requires an MCP client (like Claude Desktop or Claude CLI) to provide the elicitation tools. Your application won't work standalone - it must be invoked by an MCP client.
See the README for setup instructions.
Core Concepts
Traits
- [
Prompt] - Provides prompt metadata for a type - [
Elicit] - Main trait for eliciting values
Interaction Paradigms
- [
Select] - Choose from finite options (enum pattern) - [
Affirm] - Yes/no confirmation (bool pattern) - [
Survey] - Multi-field elicitation (struct pattern) - [
Authorize] - Permission policies (planned for v0.2.0)
Example
use ;
# async
Derive Macros
The library provides derive macros for automatic implementation:
use Elicit;
// Enums automatically use the Select paradigm
// Structs automatically use the Survey paradigm
MCP Integration
The library uses the pmcp crate for high-performance MCP client integration. All elicitation happens through asynchronous MCP tool calls.