Skip to main content

Args

Struct Args 

Source
pub struct Args {
Show 22 fields pub host: String, pub port: u16, pub user: String, pub password: Option<String>, pub key: Option<PathBuf>, pub su_password: Option<String>, pub sudo_password: Option<String>, pub timeout: u64, pub max_chars: Option<String>, pub disable_sudo: bool, pub max_output_tokens: Option<String>, pub log_level: String, pub log_file: Option<PathBuf>, pub log_format: String, pub log_rotation: String, pub keepalive_interval: u64, pub keepalive_max: u64, pub reconnect_retries: u64, pub reconnect_backoff_ms: u64, pub health_probe_timeout_ms: u64, pub strict_host_key_checking: HostKeyCheckMode, pub known_hosts: Option<PathBuf>,
}
Expand description

SSH MCP Server CLI Arguments

Fields§

§host: String

SSH host to connect to

§port: u16

SSH port

§user: String

SSH username

§password: Option<String>

SSH password (alternative to key)

§key: Option<PathBuf>

Path to SSH private key file (alternative to password)

§su_password: Option<String>

Password for su elevation

§sudo_password: Option<String>

Password for sudo commands (if different from su_password)

§timeout: u64

Command execution timeout in milliseconds

§max_chars: Option<String>

Maximum characters for command length. Use “none”, “0”, or negative value to disable limit. Default: 64000

§disable_sudo: bool

Disable the sudo_shell and sudo_apply_patch tools

§max_output_tokens: Option<String>

Maximum output tokens for command execution. Use “none” or “0” to disable limit. Supports “k” suffix (e.g., “16k” for 16000). Default: 16000 (approximately 64KB)

§log_level: String

Logging level: trace, debug, info, warn, error

§log_file: Option<PathBuf>

Log file path (default: stdout only)

§log_format: String

Log format: text or json

§log_rotation: String

Log rotation strategy: daily, hourly, never

§keepalive_interval: u64

Keepalive interval in seconds (default: 30) Sends keepalive packets to maintain connection like a human user

§keepalive_max: u64

Maximum keepalive failures before disconnecting (default: 3) Total idle timeout = keepalive_interval * keepalive_max

§reconnect_retries: u64

Number of reconnect retries after the initial attempt (default: 3)

§reconnect_backoff_ms: u64

Base reconnect backoff in milliseconds (default: 250)

§health_probe_timeout_ms: u64

Health probe timeout in milliseconds for active session checks (default: 1500)

§strict_host_key_checking: HostKeyCheckMode

SSH host key checking mode: yes, accept-new, or no

§known_hosts: Option<PathBuf>

Path to known_hosts file (default: OpenSSH user known_hosts)

Trait Implementations§

Source§

impl Args for Args

Source§

fn group_id() -> Option<Id>

Report the ArgGroup::id for this set of arguments
Source§

fn augment_args<'b>(__clap_app: Command) -> Command

Append to Command so it can instantiate Self via FromArgMatches::from_arg_matches_mut Read more
Source§

fn augment_args_for_update<'b>(__clap_app: Command) -> Command

Append to Command so it can instantiate self via FromArgMatches::update_from_arg_matches_mut Read more
Source§

impl Clone for Args

Source§

fn clone(&self) -> Args

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl CommandFactory for Args

Source§

fn command<'b>() -> Command

Build a Command that can instantiate Self. Read more
Source§

fn command_for_update<'b>() -> Command

Build a Command that can update self. Read more
Source§

impl Debug for Args

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl FromArgMatches for Args

Source§

fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>

Instantiate Self from ArgMatches, parsing the arguments as needed. Read more
Source§

fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>

Instantiate Self from ArgMatches, parsing the arguments as needed. Read more
Source§

fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>

Assign values from ArgMatches to self.
Source§

fn update_from_arg_matches_mut( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>

Assign values from ArgMatches to self.
Source§

impl Parser for Args

Source§

fn parse() -> Self

Parse from std::env::args_os(), exit on error.
Source§

fn try_parse() -> Result<Self, Error>

Parse from std::env::args_os(), return Err on error.
Source§

fn parse_from<I, T>(itr: I) -> Self
where I: IntoIterator<Item = T>, T: Into<OsString> + Clone,

Parse from iterator, exit on error.
Source§

fn try_parse_from<I, T>(itr: I) -> Result<Self, Error>
where I: IntoIterator<Item = T>, T: Into<OsString> + Clone,

Parse from iterator, return Err on error.
Source§

fn update_from<I, T>(&mut self, itr: I)
where I: IntoIterator<Item = T>, T: Into<OsString> + Clone,

Update from iterator, exit on error. Read more
Source§

fn try_update_from<I, T>(&mut self, itr: I) -> Result<(), Error>
where I: IntoIterator<Item = T>, T: Into<OsString> + Clone,

Update from iterator, return Err on error.

Auto Trait Implementations§

§

impl Freeze for Args

§

impl RefUnwindSafe for Args

§

impl Send for Args

§

impl Sync for Args

§

impl Unpin for Args

§

impl UnsafeUnpin for Args

§

impl UnwindSafe for Args

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more