LabscoMCP early access ↗
GoodPieMCP SERVER · OFFICIAL PROJECT

Rails Active MCP

Rails console access for AI agents, with safety checks, read-only queries and a dry-run analyser.

by GoodPie ↗Sandboxed Code Execution✓ Official

LABSCO SUMMARY

The console, with the guardrails you would want on a shared one.

The safety model is the product: dry_run lets you ask "what would this do" before anything runs, safe_query gives real data access with no write path, and safe mode blocks the classes of statement that ruin a database. The author is upfront that this is a personal project under active development — treat production use as a decision, not a default.

What it is

A Ruby gem that exposes a Rails application's console over MCP, built on the official MCP Ruby SDK. It loads your Rails app, then offers four tools with dangerous-operation detection, timeouts and audit logging in front of them.

What you get

  • console_execute — run Ruby with safety checks, a configurable timeout, and every execution logged
  • safe_query — read-only database access with automatic result limiting; an optional where hash filters before the method runs, and the same applies to sum, average, minimum, maximum, pluck and exists?
  • model_info — schema columns and constraints, associations, validations and available methods for a model
  • dry_run — categorise code by danger level and suggest safer alternatives without ever executing it
  • Blocked outright: mass deletions, system commands, file operations, raw SQL execution, code evaluation and process manipulation, graded critical, high, medium and low
  • Environment presets — production_mode!, development_mode! and test_mode! set the safety posture in one line

Requirements

A Rails application. Add gem 'rails-active-mcp' to the Gemfile, bundle install, then rails generate rails_active_mcp:install — the installer writes an initializer, server scripts, and the project-level config files for whichever MCP clients you select, so the server is detected when you open the project. Clients the installer does not configure itself, such as Claude Desktop and Windsurf, launch bin/rails-active-mcp-wrapper, which the installer creates and which starts the server from the Rails project root. Configuration lives in config/initializers/rails_active_mcp.rb, covering safe_mode, command_timeout, max_results, allowed_models, custom safety patterns and audit logging. MIT.

Setup effort

Follow the published steps — bundle install