Rails AI Context

•
189
•
소유권 확인됨
관리

A Ruby gem and MCP server: 35 read-only tools let Claude Code, Cursor, Copilot, OpenCode and Codex CLI ask your Rails app for its schema, models, routes, controllers and views instead of guessing.

rails-ai-context lets AI coding agents ask a Rails app about itself instead of writing from memory. 35 read-only tools answer from the app: the schema with its indexes, models with associations, validations, scopes and callbacks, routes, controllers with every inherited filter and strong params, views, jobs, tests and conventions. It runs as an MCP server over stdio or HTTP, or from any terminal with no server at all. When the app cannot boot (a missing env var, an unreachable service, a broken initializer), the same tools answer from the source in a static tier: routes from config/routes.rb, the schema from db/schema.rb, db/structure.sql or the migrations, and models and controllers from their source, read with Ruby's Prism parser. Every answer says which tier it came from and marks what it could not read as [UNAVAILABLE]. The install writes the MCP config and context files for Claude Code, Cursor, GitHub Copilot, OpenCode and Codex CLI, including six rules that tell the assistant to verify before it writes. Other MCP clients (Claude Desktop, Windsurf, Zed, JetBrains IDEs) take the entry `rails-ai-context mcp-entry` prints. Every tool is read-only. The SQL tool runs inside a read-only transaction with a timeout, a row limit and column redaction, and files that hold secrets (.env, master.key, credentials) are never served. Free and MIT licensed. Ruby 3.1+ and Rails 7.0 to 8.1, on Linux, macOS and Windows.

주요 기능

0135 read-only MCP tools: schema, models, routes, controllers, views, jobs, tests and config
02Installs MCP config and context files for Claude Code, Cursor, Copilot, OpenCode and Codex CLI
03Answers when the app cannot boot: a static tier reads routes, the schema and the source files
04search_code trace returns a method's definition, every caller and its tests in one call
05Controller answers list every filter with the class it was inherited from
06Read-only SQL inside a read-only transaction, with a timeout, a row limit and column redaction

사용 사례

01Stop an AI assistant from writing a migration for a column that already exists, or calling an association by the wrong name
02Give Claude Code, Cursor or Copilot the inherited before_action filters before it writes a controller action
03Generate tests in the app's own style: its framework, its factories or fixtures, and their traits
04Read a Rails app that won't boot locally, from its routes, schema and source