Labsco
MCP SERVER

Rails MCP Server

by maquina-app

Point an assistant at a Rails project and let it read the routes, models, schema and controller-view wiring, plus the official framework guides.

Code Intelligence & Repository Indexing
Summary
Three tools in the context window, nine analyzers behind them.

Registering everything as a tool is how a useful server becomes an expensive one. Here the model calls search_tools when it needs something and pays for the rest only in the turn it uses them. The other decision worth knowing is what is missing: there is no tool that runs arbitrary Ruby, so this can read your application's structure but cannot execute against it. That makes it a comfortable thing to point at a project you care about. Start every session with switch_project and project_info — the docs are explicit that everything else assumes it.

What it is

A Ruby MCP server that introspects Rails projects. It registers only three tools with the client and hides nine analyzers behind them, which the model discovers when it needs them — so a large capability surface does not cost a large slice of the context window. It reads and reports; it does not run arbitrary Ruby.

What you get
  • Three registered tools: switch_project to choose which Rails app you are working in, search_tools to find the right analyzer, and execute_tool to run it
  • project_info — the overview to start from, before asking anything specific
  • analyze_models — associations, validations and callbacks, for one model, several, or names only; with Prism static analysis it also reports scopes and methods
  • get_schema — the whole schema with indexes, or just the table list, or named tables
  • get_routes — filtered by controller, HTTP verb, path fragment, or named routes only
  • analyze_controller_views for the controller-to-view wiring, and analyze_environment_config for how the app is configured per environment
  • get_file and list_files, which takes a glob so "all the models" or "every Stimulus controller" is one call
  • load_guide, which reads documentation into the conversation from five sets: Rails, Turbo, Stimulus, Kamal, and your own markdown imported as Custom guides
  • Guides are downloaded up front with a separate command, and your own files can be imported one at a time or a directory at once
Requirements

A local Rails project and Ruby to run the server. Two Rubies are actually involved and it matters: the client launches the server with your system default Ruby, while get_schema, get_routes and the introspection half of analyze_models and analyze_controller_views shell out to bin/rails inside the project, on that project's Ruby. Runs in stdio by default, or as HTTP with --mode http — port 6029 unless you change it, bound to localhost unless you pass --bind-all. An interactive configuration tool sets up projects and Claude Desktop for you. Everything stays on your machine.

Setup effort

One command — gem install rails-mcp-server