maquina-app/rails-mcp-server

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 it solves

This project provides a standardized way for Large Language Models (LLMs) to interact with Ruby on Rails projects. It solves the problem of giving AI agents the necessary context—such as database schemas, routes, and model relationships—to perform code analysis, exploration, and development assistance without requiring the user to manually copy-paste code into the prompt.

How it works

It implements the Model Context Protocol (MCP), allowing it to act as a bridge between an LLM client (like Claude Desktop or GitHub Copilot) and a Rails codebase. The server can run in either STDIO mode for direct integration or HTTP mode for remote access.

To minimize context window usage, it uses a "progressive tool discovery" architecture. Instead of listing every possible action, it exposes three primary bootstrap tools (switch_project, search_tools, and execute_tool) that the LLM uses to discover and invoke more specific internal analyzers on demand.

Who it’s for

Rails developers who use AI coding assistants and want to give their LLMs deep, structured access to their application's internal structure, documentation, and configuration.

Highlights

  • Deep Rails Introspection: Includes specialized analyzers for Active Record models (using Prism static analysis), Rails routes, database schemas, and controller-view relationships.
  • Documentation Integration: Provides built-in access to official guides for Rails, Turbo, Stimulus, and Kamal, as well as support for custom markdown documentation.
  • Multi-Project Management: Allows the LLM to switch between multiple configured Rails projects.
  • Flexible Deployment: Supports both STDIO and HTTP/SSE modes and integrates with common Ruby version managers (mise, asdf, rbenv, rvm).
  • Agent-Ready: Includes a dedicated configuration tool (rails-mcp-config) for easy setup with Claude Desktop and GitHub Copilot.

Related

  • Project
  • Project
  • Project
  • Project
  • Project