1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
//! SSH MCP Server - A Model Context Protocol server for remote SSH command execution
//!
//! This crate provides an MCP server that allows executing commands on remote Linux
//! systems via SSH. It supports both password and key-based authentication, as well
//! as privilege elevation via `su` and `sudo`.
//!
//! # Features
//!
//! - Execute shell commands on remote SSH servers (`exec` tool)
//! - Support for `sudo` command execution with password (`sudo-exec` tool)
//! - Persistent SSH connection with auto-reconnect
//! - Configurable command timeout
//! - Command length limits for safety
//!
//! # MCP Tools
//!
//! - `exec` - Execute a shell command on the remote SSH server
//! - `sudo-exec` - Execute a command with sudo privileges (can be disabled with `--disable-sudo`)
//! - `read-file` - Read a remote UTF-8 file with preview/head/tail/full modes
//! - `write-file` - Atomically overwrite or create a remote UTF-8 file
//! - `replace-in-file` - Atomically replace text within a remote UTF-8 file
//!
//! # Example Usage (CLI)
//!
//! ```bash
//! ssh-mcp --host=192.168.1.100 --user=admin --password=secret
//! ```
//!
//! # Example Usage (MCP Inspector)
//!
//! ```bash
//! npx @modelcontextprotocol/inspector ./target/release/ssh-mcp -- \
//! --host=YOUR_HOST --user=root --password=pass
//! ```
pub
pub
// Re-exports for convenience
pub use ;
pub use ;
pub use SshMcpServer;
pub use ;
pub use ;