Rails

v1.0.0Developer Toolsstable

A Ruby gem 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.

railsmcpai-integration
Share:
552
Stars
0
Downloads
0
Weekly
0/5

What is Rails?

Rails is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to ruby gem 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....

A Ruby gem 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.

This server falls under the Developer Tools category on MCPgee, the world's largest MCP server directory with 33,000+ servers.

Features

  • A Ruby gem implementation of a Model Context Protocol (MCP)

Use Cases

Allow AI assistants to interact with Rails projects through MCP.
Enable code analysis and project understanding for Rails applications.
maquina-app

Maintainer

LicenseMIT
Languageruby
Versionv1.0.0
UpdatedMay 21, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx rails

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

How to Set Up and Use Rails

Rails MCP Server is a Ruby gem that exposes a full suite of Rails project analysis tools to any MCP-compatible AI assistant. It lets LLMs read routes, inspect Active Record models and associations, retrieve database schemas, browse source files, analyze controllers and views, and even run sandboxed Ruby code — all without leaving the chat interface. Teams use it to accelerate Rails development by giving Claude or other models deep, accurate knowledge of a specific Rails codebase.

Prerequisites

  • Ruby 3.0 or later with RubyGems available
  • An existing Ruby on Rails project
  • An MCP client such as Claude Desktop or VS Code with MCP support
  • gem install permission (or use bundler in the project)
1

Install the rails-mcp-server gem

Install the gem globally so the executables are available system-wide.

gem install rails-mcp-server
2

Run the interactive configuration tool

The rails-mcp-config wizard guides you through registering one or more Rails project paths. It writes a projects.yml file in the config directory.

rails-mcp-config
3

Or manually edit projects.yml

Add project aliases and absolute paths to the YAML config file located at ~/.config/rails-mcp/projects.yml (macOS/Linux) or %APPDATA%\rails-mcp\projects.yml (Windows).

# ~/.config/rails-mcp/projects.yml
store: "~/projects/store"
blog: "~/projects/rails-blog"
4

Configure Claude Desktop

Add the rails-mcp-server block to your Claude Desktop configuration file.

{
  "mcpServers": {
    "rails": {
      "command": "rails-mcp-server",
      "args": []
    }
  }
}
5

Switch to a project and start querying

In your AI session, use the switch_project tool to activate one of the registered Rails projects, then use execute_tool to run analyzers like get_routes, analyze_models, or get_schema.

6

Download optional documentation guides

Fetch offline copies of Rails, Turbo, Stimulus, and Kamal docs so the load_guide tool works without internet access.

rails-mcp-server-download-resources rails
rails-mcp-server-download-resources turbo

Rails Examples

Client configuration

Claude Desktop config block for Rails MCP Server.

{
  "mcpServers": {
    "rails": {
      "command": "rails-mcp-server",
      "args": []
    }
  }
}

Prompts to try

Example queries once the server is connected and a project is active.

- "Switch to the 'store' project and show me all routes for the admin namespace"
- "Analyze the User model and explain its associations"
- "Show me the database schema for the orders table"
- "List all files in app/controllers and summarize what each does"
- "Run this Ruby snippet in the context of the blog project: Order.count"

Troubleshooting Rails

rails-mcp-server command not found after gem install

Make sure the gem bin directory is on your PATH. Run 'gem environment' to find the bin path and add it to your shell profile (e.g., export PATH="$(gem environment gemdir)/bin:$PATH").

switch_project fails with 'project not found'

Open ~/.config/rails-mcp/projects.yml and verify the project alias and path are correct. The path must be an absolute path to the Rails app root. Re-run 'rails-mcp-config' to update the file interactively.

execute_ruby raises a sandbox error

The execute_ruby tool runs in a sandboxed environment and restricts certain operations. Avoid file writes or external network calls. Use it for read-only Ruby expressions like model queries or attribute inspections.

Frequently Asked Questions about Rails

What is Rails?

Rails is a Model Context Protocol (MCP) server that ruby gem 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. It connects AI assistants to external tools and data sources through a standardized interface.

How do I install Rails?

Follow the installation instructions on the Rails GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.

Which AI clients work with Rails?

Rails works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.

Is Rails free to use?

Yes, Rails is open source and available under the MIT license. You can use it freely in both personal and commercial projects.

Browse More Developer Tools MCP Servers

Explore all developer tools servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.

Quick Config Preview

{ "mcpServers": { "rails": { "command": "npx", "args": ["-y", "rails"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

Ready to use Rails?

Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.

33,000+ ServersFree & Open SourceStep-by-Step Guides