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.
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
Maintainer
Works with
Installation
Manual Installation
npx railsConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
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)
Install the rails-mcp-server gem
Install the gem globally so the executables are available system-wide.
gem install rails-mcp-serverRun 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-configOr 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"Configure Claude Desktop
Add the rails-mcp-server block to your Claude Desktop configuration file.
{
"mcpServers": {
"rails": {
"command": "rails-mcp-server",
"args": []
}
}
}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.
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 turboRails 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.
Rails Alternatives — Similar Developer Tools Servers
Looking for alternatives to Rails? Here are other popular developer tools servers you can use with Claude, Cursor, and VS Code.
Ecc
★ 188.2kThe agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.
Javaguide
★ 155.8kJava 面试 & 后端通用面试指南,覆盖计算机基础、数据库、分布式、高并发、系统设计与 AI 应用开发
Gemini CLI
★ 104.5kA secure MCP server that wraps the Google Gemini CLI, allowing clients to query Gemini models using local OAuth sessions without requiring an API key. It provides tools for model interaction and diagnostics with built-in protection against command in
Awesome MCP Servers
★ 87.3k⭐ Curated list of Model Context Protocol (MCP) servers - tools that extend Claude Desktop, Cursor, Windsurf, and other MCP clients with custom capabilities.
MCP Servers
★ 86.0kModel Context Protocol Servers
CC Switch
★ 77.5kA cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Gemini CLI & Hermes Agent. Only official website: ccswitch.io
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.
Set Up Rails in Your Editor
Choose your AI client for step-by-step setup instructions.
Quick Config Preview
Add this to your claude_desktop_config.json or .cursor/mcp.json
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.