MCP Server: SSH Rails Runner
MCP サーバー: SSH Rails ランナー
SSH経由でRailsコンソールコマンドを安全にリモート実行できるMCPサーバー。このサーバーは、デプロイされたRails環境において、読み取り専用操作と慎重に管理されたミューテーションの両方のためのツールを提供します。
これはCursorと非常に相性が良いです。Cursor Composerを使ってRailsモデルファイルをコンテキストとして読み込み、 execute_read_only 、 dry_run_mutate 、 execute_mutateツールを使ってデータベースに変更を加えることができます。データのラングリングや分析を行うために、複雑な管理UIを苦労して操作する必要はありません。
例

Related MCP server: terminal-mcp-server
特徴
SSH経由のリモートRailsコンソール実行
安全な読み取り専用操作
突然変異のドライラン機能
承認された変異の実行
コードスニペットのリソース管理
インストール
npm install
npm run build構成
次の環境変数を設定します。
SSH_HOST=your.remote.host
SSH_USER=your_ssh_user
SSH_PRIVATE_KEY_PATH=your_SSH_PRIVATE_KEY_PATH
RAILS_WORKING_DIR=/path/to/rails/appClaude Desktopでの使用
Claude Desktop 構成に追加:
{
"mcpServers": {
"ssh-rails-runner": {
"command": "npx",
"args": ["mcp-server-ssh-rails-runner"],
"env": {
"SSH_HOST": "your.remote.host",
"SSH_USER": "your_ssh_user",
"SSH_PRIVATE_KEY_PATH": "your_SSH_PRIVATE_KEY_PATH",
"RAILS_WORKING_DIR": "/path/to/rails/app/root",
"PROJECT_NAME_AS_CONTEXT": "Name that shows up in tool descriptions to help the LLM describe what kind of Rails project we're working with.",
"CODE_SNIPPET_FILE_DIRECTORY": "/path/to/store/code/snippets/locally"
}
}
}
}CODE_SNIPPET_FILE_DIRECTORYが指定されていない場合、スニペットは一時ディレクトリ(例: /tmp/mcp-ssh-rails-runner-code-snippets )に保存されます。PROJECT_NAME_AS_CONTEXT PROJECT_NAME_AS_CONTEXTオプションであり、ツールの説明でプロジェクトのコンテキストを識別するのに役立ちます。
利用可能なツール
サーバーは準備 -> 実行ワークフローを使用するようになりました。
mcp_ssh_rails_runner_prepare_code_snippet
引数:
name(文字列、ファイル名用)、type(列挙型: "readOnly" | "mutate")、code(文字列、Ruby コード)、description(文字列、オプション)。機能: 提供された Ruby コードを
code_snippet_<name>.jsonという名前のローカル ファイルに保存し、読み取り専用または変更可能としてマークして、レビュー用にファイルを開きます。戻り値: 作成されたスニペットの
file://URI。
mcp_ssh_rails_runner_execute_code_snippet_read_only
引数:
uri(文字列、prepareCodeSnippetからのfile://URI)。機能: URI からコード スニペットを読み取り、それが
readOnlyとしてマークされていることを確認し、コードの安全性チェックを実行して実行します。戻り値: Rails コマンドの出力。
mcp_ssh_rails_runner_execute_code_snippet_mutate
引数:
uri(文字列、prepareCodeSnippetからのfile://URI)。機能:**危険ゾーン!**コードスニペットを読み取り、
mutateとしてマークされていることを確認し、直接実行します。このツールには、ドライランやそれ以上の安全性チェックは行われません。戻り値: Rails コマンドの出力。
使用方法:ユーザーが準備されたコード (
prepareCodeSnippetから開いたファイル経由) を確認し、ミューテーションを実行することを明示的に確認した後にのみ、これを呼び出します。
セキュリティに関する考慮事項
リモート環境へのアクセスが (一時的に) 提供されている、独自のローカル マシンからの信頼できる SSH エンドポイントでのみ使用してください。
**重要なのは、
executeCodeSnippetMutateでミューテーションを実行する前に、必ずprepareCodeSnippetで保存したコードを確認することです。**ミューテーションの確認は、ユーザーと呼び出し元のAIの責任となります。
ライセンス
マサチューセッツ工科大学
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Manage remote servers, SSH terminals, files, databases and proxies with scoped access and approvals.
- browser-sshDeprecatedcom.browserssh
Scoped, audited SSH exec, sessions, and SFTP on your saved servers without exposing credentials
Remote shell and detached long-running jobs on your own machines — no SSH, open ports or VPN.
Let AI operate servers without SSH. Choose actions, approve risky changes, and audit every step.
Related MCP Servers
- FlicenseAqualityDmaintenanceEnables secure remote SSH command execution with strict read-only enforcement, allowing safe delegation of SSH access to Claude while preventing write operations. Supports connection pooling, command validation, and comprehensive logging for audit trails.51-
- FlicenseBqualityDmaintenanceEnables secure remote and local command execution via SSH, with session management and environment variable support.13-
- AlicenseNot gradedqualityCmaintenanceEnables remote shell command execution and file operations with restricted/unrestricted modes, background tasks, safe editing, and code search.MIT
- AlicenseNot gradedqualityBmaintenanceEnables secure execution of arbitrary commands on remote hosts via SSH with OIDC authentication, allowlisted access, and dynamically injected private keys.MIT