MCP Server: SSH Rails Runner

by MCP-Mirror

319 downloads
Not rated
GitHub

About

An MCP server that enables secure remote execution of Rails console commands over SSH. It provides tools for read-only operations and carefully managed mutations in a deployed Rails environment, and works well with Cursor for data wrangling and analysis.

Details

Author
MCP-Mirror
Downloads
319
Categories
Developer Tools

- Remote Rails console execution over SSH
- Safe read‑only operations
- Dry‑run capability for mutations
- Execution of approved mutation code snippets
- Resource management for code snippets
- Works with Cursor and Claude Desktop

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name MCP Server: SSH Rails Runner
    Command (node, npx, python, etc.)

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

Install via npm install and npm run build, then set the environment variables SSH_HOST, SSH_USER, SSH_PRIVATE_KEY_PATH, and RAILS_WORKING_DIR. Integrate with MCP clients like Claude Desktop by adding the server to its mcpServers configuration, or use directly with Cursor Composer.

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "mcp server: ssh rails runner": {
            "ssh-rails-runner": {
                "command": "npx",
                "args": [
                    "mcp-server-ssh-rails-runner"
                ],
                "env": {
                    "SSH_HOST": "",
                    "SSH_USER": "",
                    "SSH_PRIVATE_KEY_PATH": "",
                    "RAILS_WORKING_DIR": ""
                }
            }
        }
    }
}

McpServers

{
    "ssh-rails-runner": {
        "command": "npx",
        "args": [
            "mcp-server-ssh-rails-runner"
        ],
        "env": {
            "SSH_HOST": "",
            "SSH_USER": "",
            "SSH_PRIVATE_KEY_PATH": "",
            "RAILS_WORKING_DIR": ""
        }
    }
}

MCP Server: SSH Rails Runner

An MCP server that enables secure remote execution of Rails console commands via SSH. This server provides tools for both read-only operations and carefully managed mutations in a deployed Rails environment.

This works great with Cursor. You can use Cursor Composer to pull in your Rails model files as context and then use the execute_read_only, dry_run_mutate, and execute_mutate tools to make changes to the database. No need to trudge through complicated Admin UI's to get your data wrangling and analysis done.

Example

Example

Features

- Remote Rails console execution over SSH
- Safe read-only operations
- Dry-run capability for mutations
- Execution of approved mutations
- Resource management for code snippets

Installation

npm install
npm run build

Configuration

Set the following environment variables:

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

Usage with Claude Desktop

Add to your Claude Desktop configuration:

{
	"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"
			}
		}
	}
}

Available Tools

run_read_only

Executes read-only Rails console operations. The tool will analyze the request, formulate safe read-only commands, and return the results.

dry_run_mutate

Plans and validates potential mutations. Creates a code snippet resource with the proposed changes without executing them.

execute_mutate

Executes previously approved mutation code snippets. Requires explicit user approval of a code snippet resource before execution.

Security Considerations

- Only use with trusted SSH endpoints from your own local machine that is (temporarily) provided access to the remote environment
- Review all mutations before execution

License

MIT

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.