Ssh Rails Runner MCP Server

MCP server for remote Rails code execution via SSH

Local serverstdio

What is the Ssh Rails Runner MCP server?

MCP server for remote Rails code execution via SSH. The ssh rails runner mcp server wraps that behind the Model Context Protocol, so an assistant can use it through 1 defined tool rather than through you.

What it actually does

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.

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

Its toolset

Everything the assistant can do here goes through one of these:

  • mcp_ssh_rails_runner_prepare_code_snippet — The mcp_ssh_rails_runner_prepare_code_snippet tool exposed by this server

Configuration

You will need 6 environment variables: SSH_HOST, SSH_USER, SSH_PRIVATE_KEY_PATH, RAILS_WORKING_DIR, PROJECT_NAME_AS_CONTEXT, CODE_SNIPPET_FILE_DIRECTORY. The server will not start without them, which is usually why the tools fail to appear on a first run. Keep credentials in your client's env block or a secrets manager rather than in a file you might commit.

Adding it to your client

Installation goes through your MCP client rather than a global install: point it at npm on npm and it is fetched when the client starts. The copy-paste blocks for Claude Desktop, Claude Code and Cursor are further down this page.

When to reach for it

Plenty of developer tooling servers cover similar ground. The differences that matter in practice are scope of access and how much setup stands between you and a working tool call. Ssh Rails Runner's toolset — mcp_ssh_rails_runner_prepare_code_snippet — is a fair guide to whether it matches your workflow. It is maintained by tadasant; worth a glance at recent repository activity before you build anything load-bearing on it.

SyncDev reviews every entry in this directory against the project's own documentation before publishing, and revisits them as servers change.

Caveats

  • It runs with your machine's permissions. That is convenient and also the reason to think about what you point it at before you approve a tool call.
  • Missing credentials fail quietly in some clients — if no tools show up, check the environment block first.
  • MCP clients confirm each tool call by default. Leave that on until you have watched what the ssh rails runner mcp server does with a few real requests.

Available tools

ToolWhat it does
mcp_ssh_rails_runner_prepare_code_snippetThe mcp_ssh_rails_runner_prepare_code_snippet tool exposed by this server.

How to install the Ssh Rails Runner MCP server

{
  "mcpServers": {
    "server-ssh-rails-runner": {
      "command": "npx",
      "args": ["-y", "npm"],
      "env": {
        "SSH_HOST": "your-value",
        "SSH_USER": "your-value",
        "SSH_PRIVATE_KEY_PATH": "your-value",
        "RAILS_WORKING_DIR": "your-value",
        "PROJECT_NAME_AS_CONTEXT": "your-value",
        "CODE_SNIPPET_FILE_DIRECTORY": "your-value"
      }
    }
  }
}

Add to claude_desktop_config.json, then restart Claude Desktop.

Configuration

VariableDescriptionRequired
SSH_HOSTEndpoint or connection string the server talks to.Optional
SSH_USERConfiguration value read at startup.Optional
SSH_PRIVATE_KEY_PATHCredential the server authenticates with.Yes
RAILS_WORKING_DIRFilesystem location the server is allowed to use.Optional
PROJECT_NAME_AS_CONTEXTConfiguration value read at startup.Optional
CODE_SNIPPET_FILE_DIRECTORYFilesystem location the server is allowed to use.Optional

Example prompts to try

  • Use Ssh Rails Runner to mcp ssh rails runner prepare code snippet.

Frequently asked questions

It connects Ssh Rails Runner to MCP-compatible AI assistants such as Claude and Cursor, exposing 1 tool (mcp_ssh_rails_runner_prepare_code_snippet) that the assistant can call on your behalf. Instead of copying data back and forth by hand, the assistant works with Ssh Rails Runner directly.