Rails MCP Server

An MCP server for Rails projects, allowing LLMs to interact with your application.

Local serverstdio

What is the Rails MCP server?

Connect Rails to Claude, Cursor or any other MCP client and it stops being a tab you switch to. An MCP server for Rails projects, allowing LLMs to interact with your application. The rails mcp server is what makes that connection.

What the server does

A Ruby implementation of a Model Context Protocol (MCP) server for Rails projects. This server allows LLMs (Large Language Models) to interact with Rails projects through the Model Context Protocol, providing capabilities for code analysis, exploration, and development assistance.

The Model Context Protocol (MCP) is a standardized way for AI models to interact with their environment. It defines a structured method for models to request and use tools, access resources, and maintain context during interactions.

  • Manage multiple Rails projects
  • Browse project files and structures
  • View Rails routes with filtering options
  • Inspect model information and relationships (with Prism static analysis)
  • Get database schema information
  • Analyze controller-view relationships

Available tools

The toolset is worth reading before you wire it up, because it tells you what the integration is really for:

  • query — (String, optional) Search term (e.g., 'routes', 'model', 'schema')
  • category — (String, optional) Filter by category: models, database, routing, controllers, files, project, guides
  • detail_level — (String, optional) Output detail: 'names', 'summary', or 'full' (default: 'summary')
  • Limitations — For detailed instructions, see docs/COPILOT_AGENT.md
  • project_info — Retrieve comprehensive project information including Rails version, directory structure, and organization
  • list_files — The list_files tool exposed by this server
  • get_file — The get_file tool exposed by this server
  • get_routes — The get_routes tool exposed by this server
  • analyze_models — Analyze Active Record models with associations, validations, and optional Prism static analysis
  • get_schema — The get_schema tool exposed by this server
  • analyze_controller_views — Analyze controller-view relationships with optional Prism static analysis
  • analyze_environment_config — Analyze environment configurations for inconsistencies and security issues

Credentials and setup notes

Configuration is passed through the environment: RAILS_MCP_PROJECT_PATH. Treat anything key-shaped as a real credential — scope it to the minimum the server needs, and rotate it if it ever lands in a shared config.

Installation

Installation goes through your MCP client rather than a global install: point it at mcp-remote 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.

Where it fits

This sits in the database access group, where several servers overlap in what they claim to do but differ sharply once you actually set them up. Rails's toolset — query, category, detail_level and 10 more — is a fair guide to whether it matches your workflow.

This entry was verified against Rails's own documentation before publication; SyncDev keeps the directory reviewed rather than auto-generated.

Worth knowing first

  • 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.
  • With 13 tools registered it takes up a noticeable share of the context window; turn it off in projects that never touch Rails.
  • Keep per-call confirmation enabled while you learn its behaviour; it is the cheapest safeguard you have.

Available tools

ToolWhat it does
query(String, optional) Search term (e.g., 'routes', 'model', 'schema')
category(String, optional) Filter by category: models, database, routing, controllers, files, project, guides
detail_level(String, optional) Output detail: 'names', 'summary', or 'full' (default: 'summary')
LimitationsFor detailed instructions, see [docs/COPILOT_AGENT.md](docs/COPILOT_AGENT.md).
project_infoRetrieve comprehensive project information including Rails version, directory structure, and organization.
list_filesThe list_files tool exposed by this server.
get_fileThe get_file tool exposed by this server.
get_routesThe get_routes tool exposed by this server.
analyze_modelsAnalyze Active Record models with associations, validations, and optional Prism static analysis.
get_schemaThe get_schema tool exposed by this server.
analyze_controller_viewsAnalyze controller-view relationships with optional Prism static analysis.
analyze_environment_configAnalyze environment configurations for inconsistencies and security issues.
load_guideLoad documentation guides from Rails, Turbo, Stimulus, Kamal, or Custom.

How to install the Rails MCP server

{
  "mcpServers": {
    "github-com-maquina-app-rails": {
      "command": "npx",
      "args": ["-y", "mcp-remote"],
      "env": {
        "RAILS_MCP_PROJECT_PATH": "your-value"
      }
    }
  }
}

Add to claude_desktop_config.json, then restart Claude Desktop.

Configuration

VariableDescriptionRequired
RAILS_MCP_PROJECT_PATHFilesystem location the server is allowed to use.Optional

Example prompts to try

  • Use Rails to query.
  • Use Rails to category.
  • Use Rails to detail level.

Frequently asked questions

It connects Rails to MCP-compatible AI assistants such as Claude and Cursor, exposing 13 tools (query, category, detail_level, and more) that the assistant can call on your behalf. Instead of copying data back and forth by hand, the assistant works with Rails directly.