Cssh
No description available
Ask AI about Cssh
Powered by Claude Β· Grounded in docs
I know everything about Cssh. Ask me about installation, configuration, usage, or troubleshooting.
0/500
Reviews
Documentation
Cssh
Your local AI, on any remote server.
No deployment needed β SSH bridges the gap
Lightweight MCP server for Claude Β· Codex Β· any MCP-compatible agent over SSH.
Installation(macOS & Linux; Windows coming later)
One-line install (recommended)
curl -sSL https://raw.githubusercontent.com/Zero-noise/Cssh/main/scripts/install.sh | bash
Installs the latest release binary for your platform from GitHub Releases.
Developer install
git clone https://github.com/Zero-noise/Cssh.git && cd Cssh && ./scripts/install.sh
Builds cssh-mcp and csshctl from the local checkout with your installed Go toolchain.
The installer places binaries in ~/.csbridge/bin/, adds them to your PATH, registers the MCP server with Claude Code, and auto-approves tool permissions.
Open Claude Code and tell the AI: "Help me connect to my SSH server", and it will guide you through profile setup and connection.
Uninstall
curl -sSL https://raw.githubusercontent.com/Zero-noise/Cssh/main/scripts/uninstall.sh | bash
# or, from repo checkout:
./scripts/uninstall.sh
Verify installation
csshctl --help # CLI tool works
claude mcp list # cssh is registered (Claude Code)
If claude mcp list does not show cssh, register manually:
claude mcp add --transport stdio --scope user cssh -- ~/.csbridge/bin/cssh-mcp
Other MCP Clients
The install script registers cssh with Claude Code automatically. For other clients, add the config manually.
Binary path: ~/.csbridge/bin/cssh-mcp. Some clients don't expand ~ β get your absolute path with:
echo ~/.csbridge/bin/cssh-mcp
Cursor
~/.cursor/mcp.json (global) or .cursor/mcp.json (project):
{
"mcpServers": {
"cssh": {
"type": "stdio",
"command": "~/.csbridge/bin/cssh-mcp"
}
}
}
VS Code / GitHub Copilot
.vscode/mcp.json (workspace) or command palette β MCP: Open User Configuration:
{
"servers": {
"cssh": {
"command": "${userHome}/.csbridge/bin/cssh-mcp"
}
}
}
VS Code uses
"servers"as the root key, not"mcpServers". Use${userHome}instead of~.
Windsurf
~/.codeium/windsurf/mcp_config.json β use an absolute path for the command:
{
"mcpServers": {
"cssh": {
"command": "/Users/you/.csbridge/bin/cssh-mcp"
}
}
}
Codex CLI
~/.codex/config.toml (global) or .codex/config.toml (project):
[mcp_servers.cssh]
command = ["~/.csbridge/bin/cssh-mcp"]
Or: codex mcp add cssh -- ~/.csbridge/bin/cssh-mcp
Amp Code
~/.config/amp/settings.json (global) or .amp/settings.json (project):
{
"amp.mcpServers": {
"cssh": {
"command": "~/.csbridge/bin/cssh-mcp"
}
}
}
Or: amp mcp add cssh -- ~/.csbridge/bin/cssh-mcp
JetBrains IDEs
Settings β Tools β AI Assistant β Model Context Protocol (MCP) β + β add stdio server with command ~/.csbridge/bin/cssh-mcp.
Features
- Managed SSH master lifecycle β master processes run with
-MN; Cssh tracks process health and detects death automatically - Auto-reconnect β if an SSH master dies unexpectedly, Cssh reconnects transparently and notifies the AI agent
- Exec progress streaming β real-time output via MCP progress notifications during long-running commands
- Per-profile Cnote β persistent AI-facing notes per profile (e.g. "download to /mnt/ssd", "don't restart during business hours"); returned automatically on
ssh_connect - File transfer with verification β
scptransport with automatic SFTP/legacy-SCP fallback, SHA-256 checksums for files, and file-count verification for directories - Credential storage β passwords and key passphrases stored in OS keychain (macOS Keychain / Linux Secret Service), never in config files
- Tool annotations β all tools annotated with MCP spec hints (
readOnlyHint,destructiveHint, etc.)
How It Works
Cssh follows a simple five-step loop:
1. Setup β create profile, store credentials securely
2. Connect β establish and verify the SSH session
3. Operate β read, write, patch, transfer, execute
4. Evaluate risk β classify the action as safe or sensitive
5. Resolve β allow, deny, or require explicit approval
Security Model
Two built-in security profiles control command approval:
easy_safe (default) | ops_strict | |
|---|---|---|
| Intent | Development β trust the AI | Production β verify everything |
| Hard deny | rm -rf /, fork bombs, destructive finds | Same |
| Approval | Only irreversible ops (reboot, mkfs) | All high-risk + all sudo |
| Grant caching | Configurable TTL | Disabled (fresh approval every time) |
| Overrides | AllowReboot, AllowDiskOps | Ignored |
Additional controls: profile-only connections, workspace_roots write restrictions, limit_dir runtime narrowing, allow_root_user policy, public-host OR-precedence.
Full details: docs/security-model.md
Tools
Core β daily operations
| Tool | Description |
|---|---|
ssh_connect | Connect to a saved profile, returns connection_id |
ssh_exec | Run a command with real-time progress streaming |
ssh_read_file | Read remote file (line-numbered, supports offset/limit for large files) |
ssh_write_file | Write remote file β create, overwrite, or append (workspace-guarded) |
ssh_apply_patch | Apply unified diff patch on remote host |
ssh_transfer | Upload/download files via scp with SHA-256 verification; supports directories and rsync resume |
ssh_disconnect | Close a connection |
Session & connection management
| Tool | Description |
|---|---|
ssh_open_session | Create a persistent shell session (shared cwd/env across exec calls) |
ssh_connection_status | Inspect connection health (single or all connections) |
First-time setup flow
These tools are used once per profile. After setup, only ssh_connect is needed.
| Tool | Step | Description |
|---|---|---|
ssh_profile_setup | 1 | Create or edit profiles β template, save, or edit existing |
ssh_key_setup | 2 | Select SSH key and store passphrase via local web form |
ssh_credentials_prompt | 3 | Store password / sudo credentials securely via local web form |
Profile & privilege management
| Tool | Description |
|---|---|
ssh_profile | List or delete saved profiles |
ssh_cnote | Read or update per-profile Cnote (persistent AI-facing notes) |
ssh_privilege | Inspect or revoke privilege grants |
Build
go build -o cssh-mcp ./cmd/cssh-mcp && go build -o csshctl ./cmd/csshctl
After modifying
.gosource files, re-rungo buildto regenerate the binary.
CLI Reference
# Add a profile
csshctl profile add \
--id devbox \
--name rayna-dev \
--host 100.88.0.10 \
--user ubuntu \
--workspace-roots / \
--auth-priority key,password \
--key-path ~/.ssh/id_ed25519 \
--security-profile easy_safe
# Edit a profile
csshctl profile edit --id devbox --host 10.0.0.5 --workspace-roots /home/ubuntu/app
# Scan for SSH keys
csshctl key scan --dir ~/.ssh/
# Store credentials
csshctl secret set-password --profile devbox
csshctl secret set-key-passphrase --profile devbox
csshctl secret set-sudo-password --profile devbox
# Manage approvals
csshctl approvals list --status pending
csshctl approve apr_xxx --by yourname
Approval Flow
High-risk commands (reboot, mkfs, sudo in ops_strict, etc.) require human approval. When the AI hits one, it pauses and shows an approval_id β you approve it in another terminal:
ssh_exec("reboot")
β approval_required (id: apr_abc123)
ββ You, in another terminal ββββββββββββββββββββββββ
β $ csshctl approve apr_abc123 --by yourname β
ββββββββββββββββββββββββββββββββββββββββββββββββββββ
AI retries automatically β β command executes
AI Workflow
Full setup flow: docs/setup-flow.md Β· Runtime paths: docs/runtime.md
ssh_profile_setup(step=template|save)β create a profilessh_key_setup(profile_id=...)β select SSH key and store passphrase (if key auth)ssh_credentials_prompt(profile_id=...)β store password/sudo credentials if neededssh_connect(profile_id=...)β connect (Cnote is returned automatically)ssh_exec/ssh_read_file/ssh_write_file/ssh_transferβ work on the remote host- When a call returns
approval_required, runcsshctl approve <id>in a separate terminal, then retry withapproval_token
Notes
- Tell the AI to "record this in the Cnote" to persist profile-level rules.
- Password auth uses
SSH_ASKPASSflow. ssh_apply_patchrequirespatchandbase64on the remote host.- Default config path:
~/.csbridge/config.toml(auto-created on first run).
