Skip to content
Skillpedia
● Free and open sourceπŸ’» LocalπŸ”“ No API keyProgramming

Rails AI Context

Lets your AI agent read your real Rails schema, models, routes and controllers instead of guessing them.

172 stars on GitHubby Cris NahineLicense MITUpdated 21 days ago

How to install

This MCP is local: it runs on your computer.

It works in apps installed on your PC (Claude Desktop, Claude Code, Cursor, VS Code…). Choose your app:

Download the .mcpb file and open it with Claude Desktop.

Download the .mcpb file β†—

Ready! Now test it

Restart the app and paste one of these requests in the chat:

What columns does the users table have, and which indexes?
Show the associations and validations on the Article model before I add a comment feature.

What it is

This server gives your AI agent 35 read-only tools that look at your actual Rails app. The agent can check the columns of a table, the associations and validations of a model, the filters a controller inherits, and the test setup before it writes code. It can still answer from the source files when the app cannot boot.

What it can do

  • rails_get_schema: tables, columns, types and indexes
  • rails_get_model_details: associations, validations, enums, scopes and callbacks
  • Controller info: actions, inherited filters and strong parameters
  • Test info: framework, factories or fixtures and a template in your style
  • Method tracing: definition, callers and tests
  • search_code: search the app source
  • security_scan: scan the app using Brakeman

When to use

  • β€ΊWhen your assistant keeps inventing columns or associations that do not exist in your app
  • β€ΊWhen you want it to write a migration, test or controller that matches your conventions
  • β€ΊWhen you need to trace who calls a method before changing it

What you need

Ruby 3.1 or newer and Rails 7.0 to 8.1. Install the gem in your Rails app or standalone. Brakeman, listen and ripgrep are optional.

Skills that pair well

⭐ Skillpedia MCP Β· freeYour agent finds the right skill on its ownInstall our MCP and your agent searches 15,000+ skills whenever it needs one.Install for free β†’

Frequently asked questions

Is it free?

The readme shows an open license and a public gem. It is installed from RubyGems.

Does it change my app?

The tools are read-only, and the SQL tool runs inside a read-only transaction. The install writes config and context files for your AI tool.

Which AI tools does it support?

Claude Code, Cursor, GitHub Copilot, OpenCode and Codex CLI, according to the readme.

Does it work if the app cannot boot?

Yes. It can read config/routes.rb, the schema dump and the source in a static mode, and it marks runtime-only data as unavailable.

Are secrets exposed?

The readme says files that hold secrets are never served.

How do I install it?

Run bundle add rails-ai-context in the development group, then the install generator for your AI tool. A standalone install with gem install is also possible.

If it does not work

  • β€ΊCheck that Ruby is 3.1 or newer and Rails is 7.0 or newer with ruby -v and bundle exec rails -v.
  • β€ΊYour AI tool holds new project MCP servers back until you approve them, so approve rails-ai-context in a new session.
  • β€ΊIf the app cannot boot, run rails-ai-context init instead of the generator so it reads the source files.

5 new skills a week. 1 minute to read.