switch_projectLABSCO 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
USE CASES
Getting oriented in a Rails app you did not write
Switch to the project, take the overview, then read the routes and the models they lead to.
Working out what a change to a model would break
Read its associations, validations and callbacks, and check the schema of the table underneath.
Tracing a request from URL to template
Filter the routes to the controller, then read the controller-to-view wiring for it.
Writing code that follows current Rails conventions
Load the relevant Rails, Turbo, Stimulus or Kamal guide into the conversation instead of relying on recall.
Making the assistant follow your team's conventions
Import your own markdown as Custom guides and load them the same way as the official ones.
Checking how the app behaves in production
Read the per-environment configuration rather than guessing from the development defaults.
3 tools
Listed in project docs. Your client may show a different list.
search_toolsexecute_toolBEFORE YOU INSTALL
What to know first
Tools you get
3 tools named in the project's documentation.
Requires
- rails-mcp-server on PATH
- Rails Guides Official Ruby on Rails 8.0.2
Where it runs
All 3 documented setups run the server on your machine.
INSTALLATION
Connect your client
Server setup
gem install rails-mcp-serverMCP Clients
Claude Desktop
{
"mcpServers": {
"railsMcpServer": {
"command": "ruby",
"args": [
"<YOUR_PATH_TO_RAILS_MCP_SERVER_EXE>"
]
}
}
}Claude Desktop — SSE
{
"mcpServers": {
"railsMcpServer": {
"command": "npx",
"args": [
"mcp-remote",
"http://localhost:6029/mcp/sse"
]
}
}
}GitHub Copilot coding agent
{
"mcpServers": {
"rails": {
"type": "local",
"command": "rails-mcp-server",
"args": [
"--single-project"
],
"tools": [
"switch_project",
"search_tools",
"execute_tool"
]
}
}
}