rails
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.
claude mcp add --transport stdio maquina-app-rails-mcp-server rails-mcp-server
How to use
This Rails MCP Server provides a Ruby-based implementation of the Model Context Protocol (MCP) to enable LLMs to interact with Rails projects. It offers capabilities such as browsing project files and structure, inspecting Rails routes, analyzing model relationships with static analysis, querying the database schema, and examining controller-view relationships. It also supports sandboxed Ruby queries and provides access to Rails, Turbo, Stimulus, and Kamal documentation. When you run the server (in STDIO by default or in HTTP mode if you pass the appropriate flag), you can connect an LLM client to the MCP endpoints and issue structured MCP requests to explore, analyze, and develop within your Rails codebase. Tools discover themselves progressively, letting the LLM discover available actions as needed rather than loading everything upfront.
How to install
Prerequisites:
- Ruby and RubyGems installed on your system
- Optional: Ruby version manager (rbenv, RVM) if you manage Ruby versions
Installation steps:
-
Install the MCP server gem: gem install rails-mcp-server
-
Verify installation and available executables. You should have:
- rails-mcp-server (the MCP server itself)
- rails-mcp-config (interactive configuration tool, recommended)
- rails-mcp-setup-claude (legacy Claude Desktop script)
- rails-mcp-server-download-resources (legacy resource downloader)
-
Optional: install Gum for an enhanced configuration experience (as per the README).
- macOS: brew install gum
- Debian/Ubuntu: sudo apt install gum
- Arch Linux: yay -S gum
-
Run the server in the desired mode. STDIO mode is the default; HTTP mode can be enabled with --mode http when starting rails-mcp-server.
Notes:
- The server follows the XDG Base Directory Specification for configuration files. Configuration directories will be created automatically on first run.
- If you plan to integrate Claude Desktop, consider using rails-mcp-config first to set up and test the integration.
Additional notes
Tips and common considerations:
- In HTTP mode, you can specify a port with -p or --port (e.g., rails-mcp-server --mode http -p 8080).
- When using Claude Desktop, you can configure the MCP server entry via the Claude config JSON, including Ruby shims if you rely on a version manager.
- For multi-project setups, the configuration tool can help manage multiple Rails projects and switch between them using a YAML/Store-based approach.
- Security: If you enable HTTP mode with --bind-all, ensure you understand the network exposure and restrict access as needed.
- The server provides access to Rails, Turbo, Stimulus, Kamal documentation and supports sandboxed Ruby queries for custom analyses.
Related MCP Servers
fast
A Ruby Implementation of the Model Context Protocol
ruby-sdk
The official Ruby SDK for the Model Context Protocol.
mcp-rb
A lightweight Ruby framework for building MCP servers with a Sinatra-like DSL
sketchup
Sketchup Model Context Protocol
rails-pg-extras
MCP (Model Context Protocol) LLM interface for rails-pg-extras gem
nvim
A Ruby implementation of the MCP server protocol for Neovim