/matlantis:mt-sshfrom matlantis
Configures SSH connections to Matlantis via WebSocket using websocat. Covers key generation, public key upload, ProxyCommand setup, and VSCode Remote-SSH integration.
Ships in matlantis. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Matlantis への SSH 接続をセットアップすることで、ローカルのターミナルや VSCode から直接 Matlantis 環境にアクセスできます。SSH 接続は WebSocket 経由(websocat を使用)で確立されます。
/tmp/sshd.pid が存在することを確認(なければ Matlantis を再起動)SSH 接続は ssh_matlantis.sh(Mac/Linux)または ssh_matlantis.bat(Windows)スクリプトを ProxyCommand として使用し、websocat 経由で Matlantis の WebSocket エンドポイント (wss://<tenant>.matlantis.com/nb/<user_id>/default/api/ssh-over-ws) に接続します。
1. 前提ツールをインストールする(websocat 等)
↓
2. SSH 鍵を生成する
↓
3. 公開鍵を Matlantis にアップロードする
↓
4. ローカルの SSH を設定する(~/.ssh/config)
↓
5. 接続をテストする
brew install websocat
ssh-keygen -t rsa -b 4096
# VSCode 利用の場合はパスフレーズなし推奨
~/.ssh/id_rsa(秘密鍵)と ~/.ssh/id_rsa.pub(公開鍵)が生成されます。
~/.ssh/id_rsa.pub の内容を Matlantis の /home/jovyan/.ssh/authorized_keys に保存します。
Matlantis ターミナルで実行します。
cat /home/jovyan/id_rsa.pub >> /home/jovyan/.ssh/authorized_keys
重要: アップロード後、Matlantis を再起動してください。再起動しないと Permission denied (publickey) エラーになります。
以下の URL から ssh_matlantis.sh をダウンロードします(ブラウザでクリック)。
https://redirect.matlantis.com/api/me/ssh
ダウンロードしたファイルに実行権限を付与します。
chmod +x ~/ssh_matlantis.sh
このスクリプトにはユーザー固有の情報(MATLANTIS_USER_ID, NOTEBOOK_PRE_SHARED_KEY, MATLANTIS_DOMAIN)が自動で埋め込まれています。
スクリプトの内容:
#! /bin/bash
set -e
MATLANTIS_USER_ID=<matlantis_user_id>
NOTEBOOK_PRE_SHARED_KEY=<notebook_pre_shared_key>
MATLANTIS_DOMAIN=<tenant_name>.matlantis.com
cd $(dirname $0)
if ! command -v websocat &> /dev/null; then
if [ ! -f ./websocat ]; then
echo "websocat not found, please download and save it to $PATH"
exit 1
fi
WEBSOCAT=./websocat
else
WEBSOCAT=websocat
fi
$WEBSOCAT --binary \
-H="cookie: matlantis-notebook-pre-shared-key=${NOTEBOOK_PRE_SHARED_KEY}" \
wss://${MATLANTIS_DOMAIN}/nb/${MATLANTIS_USER_ID}/default/api/ssh-over-ws
~/.ssh/config に以下を追記します([USERNAME] は Mac のユーザー名に置き換え)。
Host matlantis
ProxyCommand /Users/[USERNAME]/ssh_matlantis.sh
User jovyan
IdentityFile ~/.ssh/id_rsa
パーミッションを設定します。
chmod 600 ~/.ssh/config
ssh -o StrictHostKeyChecking=accept-new matlantis
# または
ssh matlantis echo "SSH connection successful"
scp local_file.txt matlantis:/home/jovyan/
PowerShell で ssh.exe が使えるか確認します。
cd $HOME
ssh.exe -V
バージョンが表示されれば OK です。
ssh-keygen.exe -t rsa -b 4096
# VSCode 利用の場合はパスフレーズなし推奨
C:\Users\[USERNAME]\.ssh\id_rsa と id_rsa.pub が生成されます。
C:\Users\[USERNAME]\.ssh\id_rsa.pub の内容を Matlantis の /home/jovyan/.ssh/authorized_keys に保存します。
Matlantis ターミナルで実行します。
cat /home/jovyan/id_rsa.pub >> /home/jovyan/.ssh/authorized_keys
rm /home/jovyan/id_rsa.pub
重要: アップロード後、Matlantis を再起動してください。
以下の URL から ssh_matlantis.bat をダウンロードします。
https://redirect.matlantis.com/api/me/ssh?script_type=bat
例えば C:\Users\[USERNAME]\MyScripts\ フォルダを作成して保存します(場所は任意)。
ダウンロード時に「危険なファイル」の警告が出る場合はセキュリティチェックを外してダウンロードしてください。
bat ファイルの内容(ユーザー固有情報が自動入力されている):
@echo off
setlocal enabledelayedexpansion
set MATLANTIS_USER_ID=<matlantis_user_id>
set NOTEBOOK_PRE_SHARED_KEY=<notebook_pre_shared_key>
set MATLANTIS_DOMAIN=<tenant_name>.matlantis.com
cd /d %~dp0
set BIN_NAME=websocat.x86_64-pc-windows-gnu.exe
set BIN_URL=https://github.com/vi/websocat/releases/latest/download/%BIN_NAME%
set WEBSOCAT_PATH=C:\Program Files\Websocat\%BIN_NAME%
where %BIN_NAME% >nul 2>&1
if %errorlevel% equ 0 (
set WEBSOCAT=%BIN_NAME%
) else (
if exist "%WEBSOCAT_PATH%" (
set WEBSOCAT="%WEBSOCAT_PATH%"
) else (
curl -s -L -o %BIN_NAME% %BIN_URL%
set WEBSOCAT=%BIN_NAME%
)
)
%WEBSOCAT% --binary -H="cookie: matlantis-notebook-pre-shared-key=%NOTEBOOK_PRE_SHARED_KEY%" wss://%MATLANTIS_DOMAIN%/nb/%MATLANTIS_USER_ID%/default/api/ssh-over-ws
websocat は bat ファイルと同じフォルダに自動ダウンロードされます。失敗した場合は C:\Program Files\Websocat\ に手動で配置してください。
C:\Users\[USERNAME]\.ssh\config に以下を追記します(全て絶対パスで指定)。
Host matlantis
ProxyCommand C:\Users\[USERNAME]\MyScripts\ssh_matlantis.bat
User jovyan
IdentityFile C:\Users\[USERNAME]\.ssh\id_rsa
注意: Windows では相対パスが動作しない場合があるため、ProxyCommand と IdentityFile は必ず絶対パスで指定してください。
ssh matlantis
SSH 接続が確立できたら、VSCode の Remote-SSH 拡張機能を使って Matlantis に接続できます。
VSCode Remote-SSH を使うことで、ローカルの VSCode から直接 Matlantis 上のファイルを編集し、Notebook を実行できます。
Windows ユーザーは WinSCP を使ったファイル転送も可能です。
matlantis、ユーザー名 jovyanssh_matlantis.bat のパスを指定id_rsa 秘密鍵ファイルを指定(PuTTY 形式 .ppk に変換されます)~/.ssh/config に追加してください~/.ssh/config に ServerAliveInterval 60 を追加するとタイムアウトを防げますHost matlantis
ProxyCommand /Users/[USERNAME]/ssh_matlantis.sh
User jovyan
IdentityFile ~/.ssh/id_rsa
ServerAliveInterval 60
StrictHostKeyChecking accept-new
ssh_matlantis.sh / ssh_matlantis.bat にはプリシェアードキーが含まれています。他者と共有しないでください~/.ssh/config のパーミッションは 600 に設定してください(Mac/Linux)| エラー | 原因 | 対処 |
|---|---|---|
Permission denied (publickey) | 公開鍵のアップロード後に Matlantis を再起動していない | Matlantis を再起動してください。再起動しないと authorized_keys が反映されません |
302 ERROR | Matlantis が起動していない | ブラウザで Matlantis を起動してから SSH 接続を再試行してください |
Host key verification failed | ホスト鍵が変更された(Matlantis 再起動等) | ssh -o StrictHostKeyChecking=accept-new matlantis で再接続するか、~/.ssh/known_hosts から該当行を削除してください。恒久対策として config に StrictHostKeyChecking=accept-new を追加してください |
websocat not found(Mac) | websocat がインストールされていない | brew install websocat を実行してください |
websocat not found(Windows) | bat ファイルによる自動ダウンロードが失敗 | websocat を手動でダウンロードし、C:\Program Files\Websocat\ に配置してください |
| 接続がタイムアウトする | Matlantis の自動停止 / ネットワーク問題 | ServerAliveInterval 60 を config に追加してください。Matlantis が起動中か確認してください |
| Windows でパスが認識されない | 相対パスを使用している | ProxyCommand と IdentityFile は絶対パスで指定してください |
/tmp/sshd.pid が存在しない | SSH デーモンが起動していない | Matlantis を再起動してください |
background-job/SKILL.md): SSH 経由でのジョブ監視integrated-workflows/SKILL.md): リモートからのパイプライン実行What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
matlantis, ssh-config, websocat, remote-access, vscode-remote-ssh
npx claudepluginhub matlantis/matlantis-agent-skills --plugin matlantis17 skills in this plugin
/mt-adsorption表面への分子吸着を扱うスキルです。 吸着エネルギー, adsorption energy, 吸着構造, adsorption structure, 吸着サイト探索, adsorption site search, add_adsorbate, ontop, bridge, fcc, hcp, 吸着サイト, slab+molecule, FixAtoms, 下層固定, D3分散補正, pbe_plus_d3, Optuna, ブラックボックス最適化, 被覆率, coverage に関するコード生成時に使用してください。
/ase-basicsASE (Atomic Simulation Environment) の基礎操作を扱うスキルです。 Atoms オブジェクトの生成・編集、ase.build.molecule, ase.build.bulk, repeat, supercell, PBC (periodic boundary conditions), cell, positions, get_chemical_formula, get_distance, translate, center, 分子と結晶の違い、構造ファイルの読み書き(ase.io.read/write) に関するコード生成時に使用してください。
/mt-background-jobバックグラウンドジョブの実行・管理を扱うスキルです。 mtl-bg-job, background job, バックグラウンドジョブ, 長時間計算, チェックポイント, checkpoint, キュー管理, queue, Notebook分離実行, ブラウザ閉じても計算継続 に関するコード生成時に使用してください。
Other plugins' skills for the same job