MCP SSH Server について
MCP SSH Serverは、MCPクライアント向けにSSH経由のリモートコマンド実行とファイル操作を提供します。パスワードまたは鍵による認証、ディレクトリ操作、転送状況の追跡、ログ記録に対応します。
主な機能
- 01パスワードと鍵による認証
- 02リモートコマンドの実行
- 03ファイルのアップロードとダウンロード
- 04ディレクトリ操作
- 05転送状況の追跡とログ記録
活用シーン
- 01リモートホストでコマンドを実行
- 02ローカルとリモート間でファイルを転送
- 03リモートディレクトリと接続状態を確認
MCP 対応
MCPクライアントにSSH接続、コマンド、ファイル、ディレクトリ操作を提供します。パスワード認証と鍵認証に対応します。
設定
ローカルサーバーの設定はどのクライアントでも共通です。コピーしてクライアントの MCP 設定ファイルに貼り付けてください。
インストール方法は未掲載です
このサーバーのパッケージやリモートエンドポイントはまだ取得できていません。プロジェクトの README の手順に従ってください。
ツール
ツール一覧はまだ取得されていません
ローカルサーバーのツールはマシン上で起動して初めて取得できます。メンテナーはまだツール一覧を提供していません。
詳細
MCP SSH サーバー
Model Context Protocol(MCP)向けの強力な SSH サーバー実装です。このサーバーは、SSH プロトコルを通じて安全なリモートコマンド実行とファイル操作を可能にし、パスワード認証と鍵ベース認証の両方をサポートします。
特長
- ✨ 安全な SSH 接続管理
- 🔑 パスワード認証と鍵ベース認証
- 💻 リモートコマンド実行
- 📁 ファイル操作(アップロード/ダウンロード)
- 📊 ファイル転送の進行状況の追跡
- 🔐 権限管理
- 📂 ディレクトリ操作
- 🚀 複数ファイルの一括転送
- 📝 詳細なログ記録
インストール
- パッケージをインストールします:
npm install mcp-ssh
- Claude のデスクトップ設定(
claude_desktop_config.json)に追加します:
{
"mcpServers": {
"ssh": {
"command": "node",
"args": ["%APPDATA%/npm/node_modules/mcp-ssh/dist/server.js"],
"env": {
"SSH_PORT": "8889",
"SSH_LOG_LEVEL": "info"
}
}
}
}
使用方法
パスワード認証
$body = @{
id = "test"
host = "example.com"
port = 22
username = "user"
password = "pass123"
} | ConvertTo-Json
Invoke-RestMethod -Uri "http://localhost:8889/connect" -Method Post -Body $body -ContentType "application/json"
鍵認証
$body = @{
id = "test"
host = "example.com"
port = 22
username = "user"
privateKey = Get-Content ~/.ssh/id_rsa | Out-String
passphrase = "optional-key-passphrase" # if your key is protected
} | ConvertTo-Json
Invoke-RestMethod -Uri "http://localhost:8889/connect" -Method Post -Body $body -ContentType "application/json"
コマンドの実行
$execBody = @{
id = "test"
command = "ls -la"
} | ConvertTo-Json
Invoke-RestMethod -Uri "http://localhost:8889/exec" -Method Post -Body $execBody -ContentType "application/json"
ファイル操作
# Upload file
$uploadForm = @{
file = Get-Item -Path "localfile.txt"
remotePath = "/remote/path/file.txt"
}
Invoke-RestMethod -Uri "http://localhost:8889/upload/test" -Method Post -Form $uploadForm
# Download file
Invoke-RestMethod -Uri "http://localhost:8889/download/test?remotePath=/remote/path/file.txt" -Method Get -OutFile "downloaded.txt"
ディレクトリ操作
# List directory
Invoke-RestMethod -Uri "http://localhost:8889/ls/test?path=/remote/path" -Method Get
# Get connection status
Invoke-RestMethod -Uri "http://localhost:8889/status/test" -Method Get
開発
- リポジトリをクローンします:
git clone https://github.com/shaike1/mcp-server-ssh.git
cd mcp-server-ssh
- 依存関係をインストールします:
npm install
- ビルドします:
npm run build
- サーバーを起動します:
npm start
環境変数
SSH_PORT:サーバーポート(デフォルト:8889)SSH_LOG_LEVEL:ログレベル(デフォルト:info)
コントリビューション
- リポジトリをフォークします
- フィーチャーブランチを作成します(
git checkout -b feature/amazing-feature) - 変更をコミットします(
git commit -m 'Add some amazing feature') - ブランチにプッシュします(
git push origin feature/amazing-feature) - プルリクエストを作成します
ライセンス
MIT
コメント
Markdown 対応
AI アプリケーションが外部のツールやデータソースに統一的な方法で接続するためのオープンなプロトコルです。クライアントはモデルとの対話を担い、MCP サーバーはツール・リソース・プロンプトテンプレートを提供します。標準メッセージでやり取りするため、1 つのサーバーを複数のクライアントで再利用できます。