Rails-AI-Context Gem Provides Claude Code with Complete Rails App Model via MCP

✍️ OpenClawRadar📅 Published: April 14, 2026🔗 Source
Rails-AI-Context Gem Provides Claude Code with Complete Rails App Model via MCP
Ad

What This Is

The rails-ai-context gem addresses Claude Code's limitations with Rails applications by automatically introspecting the entire app and exposing its structure through Model Context Protocol (MCP). This gives Claude Code a complete mental model of the Rails app without manual configuration.

Key Details

The gem solves specific problems where Claude Code "guesses a lot" with Rails: reading thousands of lines in schema.rb to find one column, missing encrypted columns, not knowing Stimulus wiring, and inventing UI patterns instead of matching existing ones.

Setup requires adding to the Gemfile:

gem "rails-ai-context", group: :development

And running the generator:

rails generate rails_ai_context:install

Claude Code automatically discovers the MCP server through a .mcp.json file with zero manual setup.

The gem provides 39 tools that Claude can call directly, including:

  • rails_get_schema(table: "users")
  • rails_search_code(pattern: "can_cook?", match_type: "trace")
  • rails_validate(files: ["app/models/user.rb"])
  • rails_analyze_feature(feature: "billing")
  • rails_get_stimulus()
  • rails_get_turbo_map()

Instead of reading every file, Claude can query exactly what it needs: schema with encrypted and nullable hints, model associations and scopes, route maps, Stimulus controller-to-HTML wiring, Turbo broadcast-to-subscription mapping, and actual design system patterns.

The gem also generates a CLAUDE.md file and .claude/rules/ per-tool split files so Claude has context even without MCP.

There's a CLI fallback where the same 39 tools work as rails 'ai:tool[schema]' for any workflow.

The project is MIT licensed and requires Ruby 3.2+ and Rails 7.1+.

Ad

Who It's For

Rails developers using Claude Code who want more accurate, context-aware assistance without manual file reading or configuration.

📖 Read the full source: r/ClaudeAI

Ad

👀 See Also

Community patch adds RTL language support to Claude Desktop on Windows
Tools

Community patch adds RTL language support to Claude Desktop on Windows

A developer has created a patch that adds proper right-to-left language support to Claude Desktop on Windows, fixing broken rendering for Hebrew, Arabic, and other RTL languages. The patch injects RTL detection logic into the Electron app's renderer and includes backup/restore functionality.

OpenClawRadar
LightMem: Lightweight Memory System for LLM Agents with 10×+ Gains and 100× Lower Cost
Tools

LightMem: Lightweight Memory System for LLM Agents with 10×+ Gains and 100× Lower Cost

LightMem is a modular memory system for LLM agents that achieves up to 10.9% accuracy improvement while reducing tokens by up to 117×, API calls by up to 159×, and runtime by over 12×. It's designed for scalable long-context reasoning across agent workflows.

OpenClawRadar
OpenClaw vs Hermes: Different Design Philosophies for AI Agents
Tools

OpenClaw vs Hermes: Different Design Philosophies for AI Agents

OpenClaw is a multi-channel gateway connecting WhatsApp, Telegram, Discord, Slack, and iMessage with a massive skill ecosystem, while Hermes is a learning agent that evaluates tasks, saves patterns as reusable skills, and builds a model of your workflow over time.

OpenClawRadar
Chrome Extension Bridges Google Messages to Claude Code via MCP
Tools

Chrome Extension Bridges Google Messages to Claude Code via MCP

A developer built a Chrome extension that connects Google Messages Web to Claude Code using MCP with stdio and WebSocket transport. The extension lists chats, reads messages, and drafts replies but currently can't send messages due to Angular's zone.js isolation.

OpenClawRadar