MCPSERV.CLUB
tadasant

SSH Rails Runner

MCP Server

Secure remote execution of Rails console commands over SSH

Stale(65)
0stars
1views
Updated Feb 16, 2025

About

An MCP server that allows safe, remote execution of Rails console commands via SSH. It supports read‑only queries, dry‑run mutations, and confirmed mutations with code snippet preparation and review.

Capabilities

Resources
Access data sources
Tools
Execute functions
Prompts
Pre-built templates
Sampling
AI model interactions

Example

The SSH Rails Runner MCP server bridges the gap between an AI assistant and a live Rails application by allowing secure, remote execution of console commands over SSH. Instead of juggling browser tabs and admin panels, developers can ask an AI to query or mutate the database directly from within their conversation. This eliminates friction in data‑driven workflows, enabling rapid prototyping, debugging, and analytics without leaving the chat interface.

At its core, the server exposes three distinct tools: run_read_only, dry_run_mutate, and execute_mutate. The read‑only tool parses natural language queries, translates them into safe ActiveRecord or console commands, and returns the results. For changes that affect state, the dry‑run tool generates a code snippet resource containing the proposed mutation but stops short of execution. This allows developers to review, tweak, or reject the code before it touches production data. Once a snippet is approved, execute_mutate runs the mutation on the remote server, ensuring that only vetted changes reach the database.

Key capabilities include:

  • Secure SSH transport: All interactions are tunneled through an encrypted SSH session, protecting credentials and traffic.
  • Fine‑grained safety: Read‑only operations are automatically sandboxed, while mutations require explicit approval, reducing accidental data loss.
  • Resource management: Generated code snippets are stored as resources that can be inspected, versioned, or shared with teammates.
  • Cursor integration: By importing Rails models into the AI’s context, developers can reference tables and associations directly in their prompts.

Typical use cases span from quick data inspections during debugging sessions, to automated report generation that pulls fresh records, and even CI pipelines where an AI orchestrates migrations or seed data updates. In a research setting, analysts can ask the assistant to compute aggregates and then push results back into the application with minimal manual intervention.

Because it operates over SSH, the server can target any Rails deployment—whether on a local VM, cloud instance, or managed hosting platform—making it a versatile addition to any AI‑augmented development workflow. Its clear separation of read and write paths, combined with an explicit approval step for mutations, provides a trustworthy bridge between conversational AI and production code.