
tufantunc/ssh-mcp
Developer toolsこのページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る
MCPサーバーがモデルコンテキストプロトコルを介してLinuxサーバー向けにSSH制御を公開します。
概要
は、LinuxおよびWindowsシステム向けにSSH制御を公開し、LLMやその他のMCPクライアントがSSHを介してシェルコマンドを安全に実行できるようにします。 - SSH MCPサーバーのインストール - SSH MCPサーバーの設定 - MCPクライアントの設定(例:Claude Desktop、カーソルなど) - LinuxまたはWindowsサーバー上で自然言語によるリモートシェルコマンドの実行 - MCP準拠サーバーでSSH機能を公開 - リモートLinuxおよびWindowsシステムでシェルコマンドを実行する - パスワードまたはSSHキーによる安全な認証 - TypeScriptおよび公式MCP SDKで構築 - 自動プロセス中止機能 - 接続を閉じる前にハングプロセスを終了しようと試みる - exec: リモートサーバー上でシェルコマンドを実行する - - コマンド(必須):リモートSSHサーバーで実行するためのシェルコマンド- 説明(任意):このコマンドが何を行うかのオプションの説明(コメントとして付加) - - sudo-exec: sudoの高さを伴ったシェルコマンドを実行する - - コマンド...
概要(AI 翻訳)
SSH MCP Serverは、LLMエージェントにリモートホストへの制御されたSSHアクセスを提供する、セキュリティ第一のモデルコンテキストプロトコルサーバーです。命令分類、ポリシーベースの認可、人間のループによる承認、完全な監査ログなどが含まれます。
このサーバーが管理すべきリスク。 リモートホストにLLMシェルアクセスを与えることで、プライベートデータ、信頼できない入力、ネットワークの出国が一か所に集まることになります。これはサイモン・ウィリソンの「致命的な三重一体」です。プロンプト注入には一般的な解決策がないため、ssh-mcpはどんなコマンドでも攻撃者の影響を受けていると仮定します。実行前に分類し、ホストグループマトリックス×役割に対して認可し、破壊的な作業を承認の背後にゲートし、どちらの場合でも決定を記録します。これにより攻撃範囲は狭まります。リスクを取り除くわけではありません。あなたのものとして残るのは2つあります:決してルートアカウントに向けないこと、そして本番プロファイルで
autoの承認を設定しないこと。SECURITY.md は完全な脅威モデルを持っています。
クイックスタート
1.設置
2.構成
設定がなくてもサーバーは起動するため、クライアントやディレクトリがMCPを完成させることができます
ハンドシェイクと読み上げ tools/list — しかし**すべてのツール呼び出しは設定するまで拒否されます。
下に道の名前が書かれたメッセージが添えられています。
このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。
README
以下は原文 README の抜粋です。原文を見る。
SSH MCP Server v2
SSH MCP Server is a security-first Model Context Protocol server that gives LLM agents controlled SSH access to remote hosts — with command classification, policy-based authorization, human-in-the-loop approval, and full audit logging.
The risk this server exists to manage. Giving an LLM shell access on a remote host puts private data, untrusted input and network egress in one place — Simon Willison’s “lethal trifecta”. Prompt injection has no general fix, so ssh-mcp assumes any command may be attacker-influenced: it classifies before executing, authorizes against a role × host-group matrix, gates destructive work behind approval, and records the decision either way. That narrows the blast radius; it does not remove the risk. Two things stay yours: never point it at a root account, and never set
autoapproval on a production profile. SECURITY.md has the full threat model.
Quick Start
1. Install
npm install -g ssh-mcp
2. Configure
Without a config the server still starts, so a client or directory can complete the MCP
handshake and read tools/list — but every tool call is refused until you configure it,
with a message naming the path below. Nothing runs on a host until this step is done. The
one exception is reload-config: write the file, then call it with action: "reload" (or
restart the server) to configure a server that is already running — see
Reloading.
Create the config file at the path for your platform:
| Platform | Path |
|---|---|
| Linux | ~/.config/ssh-mcp/config.toml (or $XDG_CONFIG_HOME/ssh-mcp/config.toml) |
| macOS | ~/Library/Application Support/ssh-mcp/config.toml |
| Windows | %APPDATA%\ssh-mcp\config.toml |
[defaults]
defaultProfile = "dev"
approvalMode = "ask-destructive"
[[profiles]]
name = "dev"
host = "192.168.1.100"
port = 22
user = "deploy" # NOT root!
auth = "key"
インストール
npx ssh-mcp --host=1.2.3.4 --user=root --password=hunter2設定
{
"mcpServers": {
"ssh-mcp": {
"command": "ssh-mcp",
"env": {
"SSH_MCP_PASSWORD": "your-password"
}
}
}
}