Client Features
MCP is bidirectional: a server can call back into the client to request an LLM completion (sampling), collect input (elicitation), ask which directories it may access (roots), or push notifications. MCP-TUI answers these interactively in the TUI and non-interactively via flags in CLI mode.
Sampling
Section titled “Sampling”When a server issues sampling/createMessage, it is asking the client’s LLM to
produce a completion.
- TUI — a sampling screen shows the requested messages and lets you compose or approve a reply.
- CLI — the CLI is non-interactive, so supply a canned reply:
# inline text replymcp-tui --sampling-stub "ok" ... tool call summarize
# JSON template (can override role / model / stopReason)mcp-tui --sampling-stub-file reply.json ... tool call summarize
# reply with a tool_use block: "<tool_name>:<json args>" (SDK v1.4.0+)mcp-tui --sampling-tool-use 'search:{"q":"golang"}' ... tool call agentElicitation
Section titled “Elicitation”elicitation/create asks the user for structured input described by a schema.
- TUI — the request renders as a form built from the schema; fill it in, or decline / cancel.
- CLI — supply the answer as JSON whose keys map to the form fields:
mcp-tui --elicit-stub '{"confirm":true}' ... tool call risky_opmcp-tui --elicit-stub-file answer.json ... tool call risky_opThe reserved keys _action and _content let you exercise the decline/cancel
paths, or disambiguate a stub whose form keys would collide with the reserved
names.
Filesystem-aware servers call roots/list to learn which directories the user
has granted them.
- CLI — declare roots up front.
--rootis repeatable and takesname=path(or justpath); each becomes afile://URI.--roots-filereads a JSON file with arootsarray of{name, uri}entries. Entries from the file load first, then--rootflags append.
mcp-tui --root src=./src --root docs=./docs ... tool call reindexmcp-tui --roots-file roots.json ... tool call reindex- TUI — press
Rto open the roots editor. Edits propagate to the server through aroots/list_changednotification.
Notifications
Section titled “Notifications”Servers stream notifications — logging, progress, list-changed, resource updates, cancellations.
- CLI —
--watch-notificationswrites each notification to stderr as a one-line summary, so a pipeline can react to progress or list-changed events without parsing the full MCP log:
mcp-tui --watch-notifications ... tool call long_running_job- TUI — the Events tab shows the live stream. The debug screen’s Notifications tab adds per-type filters, a level threshold, and pause. See the keyboard reference.