loading…
Search for a command to run...
loading…
An SSH MCP server that enables users to connect to and manage remote servers directly from Claude Code. It provides tools to execute commands, monitor connectio
An SSH MCP server that enables users to connect to and manage remote servers directly from Claude Code. It provides tools to execute commands, monitor connection status, and dynamically manage server configurations through natural language.
中文 | English | Configuration Guide | 配置指南
MCP server that provides SSH remote connection capabilities for Claude Code. Connect to remote servers, execute commands, and automate deployments without needing a separate SSH terminal.
mcp-hydrocoder-ssh is an MCP (Model Context Protocol) server that enables Claude Code to:
| Benefit | Description |
|---|---|
| No window switching | Complete all remote operations within Claude Code conversation |
| Smart deployment | Claude can auto-determine next steps based on command output |
| Multi-server management | Manage multiple server configs, switch quickly |
| Secure authentication | Support SSH agent, key files |
| Connection pooling | Maintain persistent connections, avoid re-authentication overhead |
SSH Connection Tools (5):
ssh_list_servers - List all configured serversssh_connect - Connect to a serverssh_exec - Execute commands (with working directory support)ssh_get_status - Get connection statusssh_disconnect - Disconnect from serverConfiguration Management Tools (5):
ssh_add_server - Add new server configurationssh_remove_server - Remove server configurationssh_update_server - Update server configurationssh_view_config - View config (filters sensitive info)ssh_help - Show help informationnpm install -g mcp-hydrocoder-ssh
claude mcp add -s user hydrossh mcp-hydrocoder-ssh
npm install -g mcp-hydrocoder-ssh
claude mcp add hydrossh mcp-hydrocoder-ssh
claude mcp add -s user hydrossh npx mcp-hydrocoder-ssh@latest
claude mcp add hydrossh npx mcp-hydrocoder-ssh@latest
Notes:
-s userflag sets user-level MCP configuration, available to all projects- Without
-s user, configuration is project-level, only available to current project- Using
npxdoes not require pre-installing the npm package
In Claude Code, enter:
List available SSH servers
If you see a server list (empty list means no servers configured yet), the installation was successful.
git clone https://github.com/hydroCoderClaud/mcpHydroSSH.git
cd mcpHydroSSH
npm install
npm run build
Build output goes to dist/ directory:
dist/index.js - MCP server entry pointdist/ssh-manager.js - SSH connection managementdist/config.js - Configuration managementEdit ~/.claude.json:
{
"mcpServers": {
"hydrossh": {
"command": "node",
"args": ["<absolute-path>/dist/index.js"]
}
}
}
Note: Replace
<absolute-path>with your actual source directory absolute path.
Close and reopen Claude Code.
For hot-reload development:
npm run dev
Then configure Claude Code with:
{
"mcpServers": {
"hydrossh": {
"command": "npx",
"args": ["tsx", "<absolute-path>/src/index.ts"]
}
}
}
Configuration file location: ~/.hydrossh/config.json
Auto-created on first run: The ~/.hydrossh/ directory and config file are automatically created when the MCP server first starts.
After installation, you can add server configs using natural language commands.
{
"servers": [
{
"id": "prod-server",
"name": "Production Server",
"host": "example.com",
"port": 22,
"username": "deploy",
"authMethod": "agent"
},
{
"id": "test-server",
"name": "Test Server",
"host": "test.example.com",
"username": "ubuntu",
"authMethod": "key",
"privateKeyPath": "~/.ssh/id_rsa"
}
],
"settings": {
"defaultConnectTimeout": 30000,
"defaultKeepaliveInterval": 60000,
"commandTimeout": 60000,
"maxConnections": 5,
"logCommands": true
}
}
| Method | Configuration | Description |
|---|---|---|
| SSH Agent | "authMethod": "agent" |
Recommended, uses system SSH agent |
| Key File | "authMethod": "key", "privateKeyPath": "~/.ssh/id_rsa" |
Default, reads private key file |
| Password | "authMethod": "password", "password": "xxx" |
Not recommended, password stored in plaintext |
See CONFIG-GUIDE_EN.md for details.
User: List available servers
Claude: Found 2 configured servers: prod-server, test-server
User: Connect to prod-server
Claude: [ssh_connect] Connected! connectionId: xxx
User: Execute command: uptime
Claude: [ssh_exec] Returns: up 30 days, 2 users, load average: 0.1, 0.2, 0.5
User: Disconnect
Claude: [ssh_disconnect] Disconnected
User: Deploy latest code to production server
Claude: Okay, I'll execute the deployment flow...
1. Connect to prod-server
2. cd /opt/myapp && git pull
3. npm ci --production
4. sudo systemctl restart myapp
5. Check service status
6. Disconnect
Deployment complete!
authMethod: "agent"~/.hydrossh/config.json is readable only by youssh_view_config tool automatically filters passwords and key paths| Issue | Solution |
|---|---|
| SSH Agent not running | Windows: Start "OpenSSH Authentication Agent" service |
| Connection timeout | Check server address, port, network connectivity |
| Command not found | Verify npm global install or check PATH environment variable |
| Config not loaded | Check if ~/.claude.json format is correct |
| Config file not found | Auto-created on first run, or manually create ~/.hydrossh/config.json |
npm run build # Build TypeScript
npm run dev # Development mode (hot reload)
npm test # Run tests
npm run lint # Code linting
npm run format # Code formatting
| Tool | Parameters | Description |
|---|---|---|
ssh_list_servers |
none | List all configured servers |
ssh_connect |
serverId, timeout? |
Connect to server |
ssh_exec |
command, connectionId?, timeout?, cwd? |
Execute command |
ssh_get_status |
connectionId? |
Get connection status (all if not specified) |
ssh_disconnect |
connectionId? |
Disconnect (most recent if not specified) |
ssh_add_server |
id, name, host, username, port?, authMethod?, privateKeyPath?, password? |
Add server config |
ssh_remove_server |
serverId |
Remove server config |
ssh_update_server |
serverId, name?, host?, port?, username?, authMethod?, privateKeyPath?, password? |
Update server config |
ssh_view_config |
none | View config (filters sensitive info) |
ssh_help |
topic? |
Show help information |
MIT
Добавь это в claude_desktop_config.json и перезапусти Claude Desktop.
{
"mcpServers": {
"mcphydrossh": {
"command": "npx",
"args": []
}
}
}