ssh-mcp-setup
ssh-mcp-setup provides installation and configuration instructions for SSH MCP, a service enabling SSH operations through Claude. Use this when users need to install ssh-licco via npx, npm, pip, or source code; update existing installations; understand the three-layer auto-install architecture; or troubleshoot setup issues with dependency management and environment detection.
git clone --depth 1 https://github.com/Echoqili/ssh-licco /tmp/ssh-mcp-setup && cp -r /tmp/ssh-mcp-setup/docs/skills/ssh-mcp-setup ~/.claude/skills/ssh-mcp-setupSKILL.md
# Local Setup and Configuration Guide
## Installation
### Method 1: npx One-Click (Recommended, Zero Config)
```bash
npx ssh-licco
```
First run automatically: detect Python → create venv → install dependencies → verify integrity → start MCP server. **No manual setup needed.**
This creates an isolated Python venv at `~/.ssh-licco-venv` and avoids all conflicts.
### Method 2: From npm (Recommended for Windows)
```bash
npm install -g ssh-licco
```
Post-install script (`install.js`) auto-detects existing venv and performs incremental update.
### Method 3: From PyPI
```bash
pip install ssh-licco
```
### Method 4: From Source
```bash
git clone https://github.com/Echoqili/ssh-licco.git
cd ssh-licco
pip install -e .
```
### Update Version
```bash
# npm
npm update -g ssh-licco
# pip
pip install --upgrade ssh-licco
```
## Auto-Install System Architecture
ssh-licco uses a **three-layer architecture** for zero-config startup:
```
User → npx ssh-licco
↓
┌──── ssh-licco.js (Node Layer) ────┐
│ ① Find Python 3.10+ │
│ ② Detect Anaconda environment │
│ ③ Create/reuse ~/.ssh-licco-venv │
│ ④ pip install dependencies │
│ ⑤ Verify dependency integrity │
└──────────┬────────────────────────┘
↓
┌── cli.py (Python Entry) ──────┐
│ Only starts MCP server │
└──────────┬────────────────────┘
↓
┌── SSHMCPServer (MCP Service) ─┐
│ SSH connect, execute, etc. │
└───────────────────────────────┘
```
### Smart Install Features
| Feature | Description |
|---------|-------------|
| **Anaconda Auto-Detect** | Detects conda environment, uses isolated venv to avoid conflicts |
| **Dependency Integrity Check** | Verifies all dependencies on every startup, auto-repairs if missing |
| **Incremental Update** | Doesn't delete existing venv, uses `pip install -e .` for incremental install |
| **Auto-Repair** | Auto re-installs when dependencies are corrupted, no manual intervention |
### Key Files
| File | Purpose |
|------|---------|
| `ssh-licco.js` | Node.js wrapper - environment prep, integrity check, startup |
| `install.js` | npm postinstall script - incremental install |
| `smart_install.py` | Standalone diagnostic install script |
| `cli.py` | Python entry point - only starts the MCP server |
## Requirements
- **Python**: >=3.10, <3.14
- **Core dependencies**: mcp>=1.0.0, asyncssh>=2.17.0, paramiko>=2.0.0, pydantic>=2.0.0, pydantic-settings>=2.0.0
- **Key management**: cryptography (for SSH key generation)
## Trae IDE MCP Configuration
### Stable Configuration Pattern (Recommended)
The most stable approach is to use the **isolated venv** directly, bypassing Node.js wrapper and Anaconda:
```json
{
"mcpServers": {
"ssh-licco": {
"command": "C:\\Users\\<YourName>\\.ssh-licco-venv\\Scripts\\ssh-licco.exe",
"env": {
"SSH_HOST": "192.168.1.100",
"SSH_USER": "root",
"SSH_PASSWORD": "your_password",
"SSH_PORT": "22",
"SSH_TIMEOUT": "60",
"SSH_KEEPALIVE_INTERVAL": "30",
"SSH_SESSION_TIMEOUT": "7200",
"SSH_SECURITY_LEVEL": "balanced",
"SSH_EXTRA_ALLOWED_COMMANDS": "git,pip,npm,docker,sh"
}
}
}
}
```
**Why this pattern is stable:**
- `~/.ssh-licco-venv` is an **isolated Python environment** created by the auto-installer
- It is **completely independent** of Anaconda, system Python, or npm
- No Node.js wrapper layer means **no shell command parsing issues** on Windows
- Editor directly communicates with the Python MCP server via stdio
Linux/macOS equivalent:
```json
{
"command": "/home/<user>/.ssh-licco-venv/bin/ssh-licco"
}
```
### Method 1: Via Settings UI
1. Open Trae IDE Settings
2. Search for "MCP"
3. Add SSH MCP server
4. Configure command: `C:\Users\<YourName>\.ssh-licco-venv\Scripts\ssh-licco.exe`
5. Add environment variables
### Method 2: Via JSON Config
Find MCP config file location:
- **Trae IDE**: `C:\Users\<YourName>\AppData\Roaming\Trae\User\mcp.json`
### How MCP Environment Affects Stability
MCP (Model Context Protocol) uses **stdio** (stdin/stdout) for JSON-RPC communication. The editor and MCP server exchange JSON messages over these pipes. This means:
1. **Any non-JSON output to stdout breaks the protocol** — install logs, warnings, progress bars all corrupt the MCP handshake
2. **stderr is safe** — it's a separate pipe for server logs
3. **Startup must be fast** — if the server takes too long to start, the editor times out and abandons the connection
**Common failure patterns and solutions:**
| Problem | Cause | Solution |
|---------|-------|----------|
| Tools not showing | Server output to stdout corrupted protocol | Use venv directly (no wrapper) |
| `ModuleNotFoundError` | Anaconda package corrupted | Clean `~` prefix dirs, reinstall to venv |
| Timeout on startup | Wrapper doing pip install on every start | Fix integrity check (don't use `shell: true` on Windows) |
| `Cannot find module` | Damaged npm global package | Run `npm uninstall -g ssh-licco` |
## Environment Variables
### Connection Settings
| Variable | Default | Description |
|----------|---------|-------------|
| SSH_HOST | 127.0.0.1 | SSH server hostname |
| SSH_PORT | 22 | SSH server port |
| SSH_USER | root | SSH username |
| SSH_PASSWORD | - | SSH password |
| SSH_TIMEOUT | 60 | Connection timeout (seconds) |
| SSH_KEEPALIVE_INTERVAL | 30 | Keepalive interval (seconds) |
| SSH_SESSION_TIMEOUT | 7200 | Session timeout (seconds) |
| SSH_CLIENT_TYPE | asyncssh | SSH client (paramiko/asyncssh) |
| SSH_FORCE_ENV_CONFIG | false | Force env vars as highest priority |
| SSH_LICCO_AUTO_INSTALL | true | Enable/disable auto-install on first run |
### Security Settings
| Variable | Default | Description |
|----------|---------|-------------|
| SSH_SECURITY_LEVEL | balanced | Security level (strict/balanced/relaxed) |
| SSH_EXTRA_ALLOWED_COMMANDS | - | Additional allowed commands (coImplement tasks from an OpenSpec change. Use when the user wants to start implementing, continue implementation, or work through tasks.
Archive a completed change in the experimental workflow. Use when the user wants to finalize and archive a change after implementation is complete.
Enter explore mode - a thinking partner for exploring ideas, investigating problems, and clarifying requirements. Use when the user wants to think through something before or during a change.
Propose a new change with all artifacts generated in one step. Use when the user wants to quickly describe what they want to build and get a complete proposal with design, specs, and tasks ready for implementation.
Complete OpenSpec spec-driven development workflow. Guides feature development from proposal through design, tasks, implementation, and archival.
SSH MCP server development guide. Invoke when working on ssh-licco project, including setup, debugging, version management, Docker deployment, and releases.
SSH MCP operations guide. Invoke when user needs to perform SSH server operations like connecting, executing commands, file transfer, or Docker management.