crisnahine/rails-ai-context
Turn any Rails app into an AI-ready codebase — one gem install. Auto-introspects models, routes, schema, jobs & exposes them via MCP.
Platform-specific configuration:
{
"mcpServers": {
"rails-ai-context": {
"command": "npx",
"args": [
"-y",
"rails-ai-context"
]
}
}
}Add the config above to .claude/settings.json under the mcpServers key.
Turn any Rails app into an AI-ready codebase — one gem install.
[](https://rubygems.org/gems/rails-ai-context) [](https://github.com/crisnahine/rails-ai-context/actions) [](LICENSE)
---
You open Claude Code, Cursor, or Copilot and ask: *"Add a draft status to posts with a scheduled publish date."*
The AI doesn't know your schema, your Devise setup, your Sidekiq jobs, or that Post already has an enum :status. It generates generic code that doesn't match your app.
rails-ai-context fixes this. It auto-introspects your entire Rails app and feeds everything to your AI assistant — schema, models, routes, controllers, jobs, gems, auth, API, tests, config, and conventions — through the Model Context Protocol (MCP).
No configuration. No manual tool definitions. Just `bundle add` and go.
> [Full Guide](docs/GUIDE.md) — complete documentation with every command, parameter, and configuration option.
---
bundle add rails-ai-context
rails generate rails_ai_context:install
rails ai:contextThat's it. Three commands. Your AI assistant now understands your entire Rails app.
The install generator creates .mcp.json for auto-discovery — Claude Code and Cursor detect it automatically. No manual MCP config needed.
---
rails ai:context generates 17 files tailored to each AI assistant:
your-rails-app/
│
├── 🟣 Claude Code
│ ├── CLAUDE.md ≤150 lines (compact)
│ └── .claude/rules/
│ ├── rails-schema.md table listing
│ ├── rails-models.md Loading reviews...