Skip to main content
Glama
Steph-ux

ssh-mcp

by Steph-ux

ssh-mcp v4.0

Linuxホストおよびネットワークデバイスにわたる永続的なSSH作業のためのMCPサーバー。

機能

  • 永続的なSSH接続(自動再接続付き)

  • 安全な資格情報の保存(Windows Credential Manager経由)

  • ネットワークデバイス対応: Cisco IOS/IOS-XE/XR、MikroTik、FortiGate、Juniper

  • 設定管理: ネットワークデバイス向けのバックアップ、リストア、差分

  • SFTP: アップロード、ダウンロード、リモートファイルの一覧表示

  • SSHトンネル: 永続的なポートフォワーディング

  • レート制限: デバイスの飽和を防止(コマンド間の最小間隔100ms)

  • スマート接続: ssh_connect(alias='vps') を使用して保存済みの資格情報を自動的に読み込む

Related MCP server: SSH MCP Server

クイックスタート

1. サーバーを保存(一度だけ)

ssh_save_server(
    alias='vps',
    host='192.168.10.1',
    username='sassogba',
    password='your-password',
    auto_connect=True  # Auto-connect on startup
)

2. 接続(シンプルモード)

ssh_connect(alias='vps')  # Loads credentials from servers.json

3. コマンドを実行

ssh_exec(alias='vps', command='df -h')
ssh_exec_sudo(alias='vps', command='systemctl restart nginx', sudo_password='...')

v4.0の新機能

スマート接続モード

  • ssh_connect はエイリアスだけを受け取り、資格情報を自動的に読み込むようになりました

  • 毎回ホスト、ユーザー名、パスワードを指定する必要はありません

  • Claude Code統合の問題を修正

重要な修正

  • タイムアウト処理: 不完全なバッファを静かに返す代わりに、TimeoutError を発生させるようになりました

  • レート制限: デバイスの飽和を防ぐため、ネットワークコマンド間の最小間隔は100ms

  • マジックナンバーの排除: シェル寸法に名前付き定数を使用

ドキュメント

  • 完全な使用例を含む新しい CLAUDE_CODE_USAGE.md

  • 設定用の新しい CLAUDE_CODE_SETUP.md

  • 完全なバージョン履歴を含む新しい CHANGELOG.md

セキュリティモデル

servers.json は機密性のないメタデータのみを保持します。シークレットはWindows Credential Managerの以下のようなターゲットに保存されます:

  • ssh-mcp:<alias>:password

  • ssh-mcp:<alias>:key_passphrase

ホストキーポリシー

  • strict: デフォルト。未知のホストキーを拒否(本番環境)

  • auto_add: 未知のホストキーを受け入れる(ラボのみ)

ネットワークデバイス

対応デバイスタイプ:

  • cisco - Cisco IOS/IOS-XE

  • cisco_xr - Cisco IOS-XR

  • mikrotik - MikroTik RouterOS

  • fortigate - FortiGate FortiOS

  • juniper - Juniper JunOS

  • generic - Linux/Unix(デフォルト)

例: Ciscoバックアップ

# Save once
ssh_save_server(
    alias='cisco-core',
    host='10.0.0.1',
    username='admin',
    password='...',
    device_type='cisco',
    auto_connect=True
)

# Connect
ssh_connect(alias='cisco-core')

# Backup config
ssh_backup_config(alias='cisco-core', device_type='cisco')
# Saved to: backups/cisco-core/cisco-core_2026-05-31_14-30-00.txt

# Execute commands
ssh_exec_network(
    alias='cisco-core',
    commands=['show version', 'show ip interface brief'],
    device_type='cisco'
)

# Push config
ssh_push_config(
    alias='cisco-core',
    config='''
interface GigabitEthernet0/1
 description Uplink to Core
 ip address 10.0.1.1 255.255.255.0
 no shutdown
''',
    device_type='cisco',
    save_config=True
)

Claude Codeでの使用

詳細な例については CLAUDE_CODE_USAGE.md を参照してください。

TL;DR:

1. Save: ssh_save_server(alias='vps', host='192.168.10.1', username='sassogba', password='...')
2. Connect: ssh_connect(alias='vps')
3. Execute: ssh_exec(alias='vps', command='df -h')

利用可能な18のツール

接続管理

  • ssh_connect - 永続的なSSH接続を確立(スマートモード: エイリアスを指定するだけ)

  • ssh_disconnect - 接続とトンネルを閉じる

  • ssh_list - ステータス付きでアクティブな接続を一覧表示

永続設定

  • ssh_save_server - サーバーを servers.json に保存(シークレットはCredential Managerに保存)

  • ssh_remove_server - 保存済みサーバーを削除

  • ssh_list_servers - 保存済みの全サーバーを一覧表示

Linux/Unixでの実行

  • ssh_exec - シェルコマンドを実行

  • ssh_exec_sudo - sudoで実行(パスワードを自動注入)

ネットワークデバイスでの実行

  • ssh_exec_network - ネットワークデバイスでコマンドを実行(ページネーション、プロンプトを処理)

  • ssh_push_config - 設定ブロックを適用

  • ssh_backup_config - 実行中設定をローカルファイルにバックアップ

  • ssh_restore_config - バックアップファイルから設定を復元

  • ssh_diff_config - 設定を比較(gitスタイルの差分)

SFTP

  • ssh_upload - ファイルをリモートサーバーにアップロード

  • ssh_download - リモートサーバーからファイルをダウンロード

  • ssh_list_remote - リモートディレクトリの内容を一覧表示

トンネル

  • ssh_tunnel - 永続的なSSHトンネルを作成(ポートフォワーディング)

  • ssh_close_tunnel - ラベルでトンネルを閉じる

アーキテクチャ

  • SSHPool: 自動再接続を備えたスレッドセーフな接続プール

  • SSHConnection: スレッドセーフティのためのRLockを備えた接続ごとの状態

  • ThreadPoolExecutor: 同期式のParamikoをラップするAsync/awaitラッパー

  • レートリミッター: デバイスの飽和を防ぐため、コマンド間の最小間隔は100ms

  • タイムアウト処理: 複数レベル(コマンドごと、合計、絶対)で、適切なエラー伝播を備える

要件

paramiko>=3.0.0
mcp>=1.0.0
pywin32>=306

インストール:

pip install -r requirements.txt

テストの実行

python -m pytest tests -v

ドキュメント

ライセンス

MIT

F
license - not found
Not graded
quality - not tested
B
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    A
    quality
    D
    maintenance
    Enables secure SSH connections to multiple remote servers with support for command execution, file transfers (SFTP), directory listing, and both password and key-based authentication.
    7
    MIT
  • A
    license
    A
    quality
    D
    maintenance
    Enables remote server management through SSH and SFTP, supporting command execution, file transfers, and interactive shell sessions. It allows for multiple concurrent connections using either password or SSH key authentication.
    11
    14
    3
    MIT
  • A
    license
    A
    quality
    Not graded
    maintenance
    Enables persistent SSH sessions and SFTP file transfers with native GUI credential prompts for secure remote server management. It supports background command execution, session pooling, and automatic connection reuse across multiple commands.
    7
  • A
    license
    A
    quality
    A
    maintenance
    Enables remote server administration via SSH, supporting command execution, SFTP file transfers, and multi-profile management. It features security safeguards like destructive command detection and audit logging to ensure safe interaction with remote Linux/Unix environments.
    17
    13
    MIT

View all related MCP servers

Related MCP Connectors

  • Let AI operate servers without SSH. Choose actions, approve risky changes, and audit every step.

  • Operate Linux, macOS and Windows from your LLM. Every action runs through an auditable allowlist.

  • Issue, rotate and revoke scoped API-key passes for 25+ providers — the agent never sees a real key

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Steph-ux/ssh-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server