terminal-mcp 0.1.5

Model Context Protocol (MCP) server for long-lived shell execution.
// src/protocol/params/io.rs
use rmcp::schemars;
use serde::Deserialize;

#[derive(Debug, Deserialize, schemars::JsonSchema)]
pub struct SendParams {
    /// Content to send
    pub input: String,
    /// Target session identifier
    pub tag: String,
}

#[derive(Debug, Deserialize, schemars::JsonSchema)]
pub struct OutputParams {
    /// Target session identifier
    pub tag: String,
    /// Idle timeout, in milliseconds, default 200 (If the terminal screen content changes, refresh and wait until there is no change within idle_ms. Usually just keep the default.)
    pub idle_ms: Option<u64>,
}

#[derive(Debug, Deserialize, schemars::JsonSchema)]
pub struct WaitForParams {
    /// Target session identifier
    pub tag: String,
    /// Substring expected to appear in stdout or stderr; returns immediately once matched
    pub substring: String,
    /// Maximum time to wait in milliseconds; returns whatever has been collected so far
    /// even if the pattern was not matched, default 5000
    pub timeout_ms: Option<u64>,
}