
Rails AI Context
Gives Claude Code, Cursor, Copilot, OpenCode and Codex 35 read-only tools that read a Rails app itself instead of guessing. Over MCP each tool carries a rails_ prefix: rails_get_schema returns columns, indexes and the model on a table, rails_get_model_details lists associations, validations, scopes and callbacks, rails_get_controllers shows actions with inherited filters and strong params, and rails_query runs read-only SQL inside a read-only transaction. Every answer says whether it was verified at runtime or inferred from source, and the tools still work from the routes file and schema dump when the app cannot boot. Install the gem in development with bundle add rails-ai-context, then run the rails_ai_context:install generator for your AI tool. The same tools also run from the command line.
- GitHub stars
- 172
- tools
- 35
- transport
- STDIO
- last updated
- Oct 31, 2026
Tools
35 toolsPublic tool metadata for what this MCP can expose to an agent.
rails_search_codeSearch your codebase with regex, ripgrep acceleration, and sensitive file blocking. Every line returned passes through redaction, so in a file no pattern names a string literal under a secret-named key (8+ characters, unless it is clearly not a credential: a message, URL, path...
Search your codebase with regex, ripgrep acceleration, and sensitive file blocking. Every line returned passes through redaction, so in a file no pattern names a string literal under a secret-named key (8+ characters, unless it is clearly not a credential: a message, URL, path...
No parameter schema in public metadata yet.
rails_get_edit_contextMethod-aware code extraction with surrounding class context. Every line returned passes through redaction, so in a file no pattern names a string literal under a secret-named key (8+ characters, unless it is clearly not a credential: a message, URL, path, placeholder, version,...
Method-aware code extraction with surrounding class context. Every line returned passes through redaction, so in a file no pattern names a string literal under a secret-named key (8+ characters, unless it is clearly not a credential: a message, URL, path, placeholder, version,...
No parameter schema in public metadata yet.
rails_analyze_featureFull-stack feature analysis: models + controllers + routes + services (with the files that call them) + admin resources + jobs and Sidekiq workers + views + tests in one call.
Full-stack feature analysis: models + controllers + routes + services (with the files that call them) + admin resources + jobs and Sidekiq workers + views + tests in one call.
No parameter schema in public metadata yet.
rails_get_contextComposite context: schema + model + controller + routes + views for a resource. Views come from the directory Rails resolves for the controller; a flat-directory fallback is labelled.
Composite context: schema + model + controller + routes + views for a resource. Views come from the directory Rails resolves for the controller; a flat-directory fallback is labelled.
No parameter schema in public metadata yet.
rails_onboardNarrative app walkthrough for getting up to speed. The stack line counts the
Narrative app walkthrough for getting up to speed. The stack line counts the
No parameter schema in public metadata yet.
rails_get_schemaDatabase schema with column types, indexes, defaults, encrypted hints. Booted,
Database schema with column types, indexes, defaults, encrypted hints. Booted,
No parameter schema in public metadata yet.
rails_get_model_detailsAST-parsed model internals. The model heading and each scope carry a confidence tag: `[VERIFIED]` or `[INFERRED]` on a booted app, `[STATIC]` without a boot. The method list says how many of the model's methods it is showing. On the static tier a model of the primary database...
AST-parsed model internals. The model heading and each scope carry a confidence tag: `[VERIFIED]` or `[INFERRED]` on a booted app, `[STATIC]` without a boot. The method list says how many of the model's methods it is showing. On the static tier a model of the primary database...
No parameter schema in public metadata yet.
rails_get_callbacksCallbacks grouped by type, in Rails event order, with source code at
Callbacks grouped by type, in Rails event order, with source code at
No parameter schema in public metadata yet.
rails_get_concernConcern methods, their source code at `detail:"full"`, and which models include it. A class under
Concern methods, their source code at `detail:"full"`, and which models include it. A class under
No parameter schema in public metadata yet.
rails_get_controllersController actions with inherited filters, render map, strong params. Includes schema hints for referenced models.
Controller actions with inherited filters, render map, strong params. Includes schema hints for referenced models.
No parameter schema in public metadata yet.
rails_get_routesRoutes with code-ready helpers (`post_path(@record)`) and required params. A
Routes with code-ready helpers (`post_path(@record)`) and required params. A
No parameter schema in public metadata yet.
rails_get_viewView templates with instance variables, Turbo frames, Stimulus controllers, partial locals. Includes schema hints for detected ivars. At `standard` detail the listing opens with the form builders the views call, each with its count (`form_with (2)`), and the ViewComponents the...
View templates with instance variables, Turbo frames, Stimulus controllers, partial locals. Includes schema hints for detected ivars. At `standard` detail the listing opens with the form builders the views call, each with its count (`form_with (2)`), and the ViewComponents the...
No parameter schema in public metadata yet.
rails_get_stimulusStimulus controller data-attributes (with dashes, not underscores) + targets +
Stimulus controller data-attributes (with dashes, not underscores) + targets +
No parameter schema in public metadata yet.
rails_get_partial_interfaceWhat locals to pass to a partial and what methods are called on them. Render sites are `render` calls, a `partial:` passed to a Turbo Stream action (`turbo_stream.prepend`) or a broadcast (`broadcast_prepend_to` in a model, controller, job or channel), and jbuilder's `json.par...
What locals to pass to a partial and what methods are called on them. Render sites are `render` calls, a `partial:` passed to a Turbo Stream action (`turbo_stream.prepend`) or a broadcast (`broadcast_prepend_to` in a model, controller, job or channel), and jbuilder's `json.par...
No parameter schema in public metadata yet.
rails_get_turbo_mapTurbo Stream broadcast-to-subscription wiring with mismatch warnings. Streams are compared the way Turbo names them, part by part: a record by its model, a symbol or string by its text. So `broadcast_prepend_to [product, :reviews]` (or `broadcast_prepend_to product, :reviews`)...
Turbo Stream broadcast-to-subscription wiring with mismatch warnings. Streams are compared the way Turbo names them, part by part: a record by its model, a symbol or string by its text. So `broadcast_prepend_to [product, :reviews]` (or `broadcast_prepend_to product, :reviews`)...
No parameter schema in public metadata yet.
rails_get_test_infoTest fixtures, relationships, and template matching your project's patterns.
Test fixtures, relationships, and template matching your project's patterns.
No parameter schema in public metadata yet.
rails_generate_testTest scaffolding that matches your project's patterns (fixtures vs factories, RSpec vs Minitest).
Test scaffolding that matches your project's patterns (fixtures vs factories, RSpec vs Minitest).
No parameter schema in public metadata yet.
rails_validateSyntax + semantic + Brakeman security validation in one call.
Syntax + semantic + Brakeman security validation in one call.
No parameter schema in public metadata yet.
rails_security_scanBrakeman static analysis: SQL injection, XSS, mass assignment, command injection. A scan that fails, on an unknown check name for one, answers "Brakeman scan failed: ..." as an error response: `isError` over MCP and exit 1 on the CLI. A brakeman run from outside the bundle tha...
Brakeman static analysis: SQL injection, XSS, mass assignment, command injection. A scan that fails, on an unknown check name for one, answers "Brakeman scan failed: ..." as an error response: `isError` over MCP and exit 1 on the CLI. A brakeman run from outside the bundle tha...
No parameter schema in public metadata yet.
rails_performance_checkN+1 query risks, missing indexes, missing counter_cache, eager load candidates.
N+1 query risks, missing indexes, missing counter_cache, eager load candidates.
No parameter schema in public metadata yet.
rails_get_configThe app's configuration, one section per call. `section` picks it; the default, `app`, is what the tool answered before it took sections. Ten tools that each answered one section were folded in, and their old names still work: the CLI resolves `gems`, `rails_get_gems` and the...
The app's configuration, one section per call. `section` picks it; the default, `app`, is what the tool answered before it took sections. Ten tools that each answered one section were folded in, and their old names still work: the CLI resolves `gems`, `rails_get_gems` and the...
No parameter schema in public metadata yet.
rails_get_helper_methodsApplication and framework helpers, with view cross-references at `detail:"full"`.
Application and framework helpers, with view cross-references at `detail:"full"`.
No parameter schema in public metadata yet.
rails_get_service_patternService object interface, dependencies, side effects, callers, read from
Service object interface, dependencies, side effects, callers, read from
No parameter schema in public metadata yet.
rails_get_job_patternBackground job queue, retries, guard clauses, broadcasts, schedules. Jobs are
Background job queue, retries, guard clauses, broadcasts, schedules. Jobs are
No parameter schema in public metadata yet.
rails_get_component_catalogViewComponent/Phlex components: props, slots, previews, sidecar assets, usage examples. Components are read from every `app/components`, packs and in-repo engines included. The type follows the superclass chain through the app's own base classes; anything the chain cannot plac...
ViewComponent/Phlex components: props, slots, previews, sidecar assets, usage examples. Components are read from every `app/components`, packs and in-repo engines included. The type follows the superclass chain through the app's own base classes; anything the chain cannot plac...
No parameter schema in public metadata yet.
rails_get_mailersActionMailer mailers: every mailer class with its delivery actions and delivery method. The actions include the public methods a mailer inherits from the app's own mailers below `ApplicationMailer`, on both tiers. A mailer that declares no action of its own - one taking them f...
ActionMailer mailers: every mailer class with its delivery actions and delivery method. The actions include the public methods a mailer inherits from the app's own mailers below `ApplicationMailer`, on both tiers. A mailer that declares no action of its own - one taking them f...
No parameter schema in public metadata yet.
rails_dependency_graphModel association graph in Mermaid or text format.
Model association graph in Mermaid or text format.
No parameter schema in public metadata yet.
rails_migration_advisorMigration code generation with duplicate/nonexistent column warnings, reversibility flags, table name normalization. The generated class is stamped with the app's own Rails version (from the booted app, or from `Gemfile.lock` under `--no-boot`); when neither names one, the out...
Migration code generation with duplicate/nonexistent column warnings, reversibility flags, table name normalization. The generated class is stamped with the app's own Rails version (from the booted app, or from `Gemfile.lock` under `--no-boot`); when neither names one, the out...
No parameter schema in public metadata yet.
rails_search_docsBundled topic index with weighted keyword search. Optional on-demand GitHub fetch.
Bundled topic index with weighted keyword search. Optional on-demand GitHub fetch.
No parameter schema in public metadata yet.
rails_querySafe read-only SQL with layered security: the SQL gate, a PostgreSQL plan check (whole-row leaks, expanded secret columns and VOLATILE admin functions refused before anything runs), `SET TRANSACTION READ ONLY`, timeout, and column redaction. [Learn about the security model →](...
Safe read-only SQL with layered security: the SQL gate, a PostgreSQL plan check (whole-row leaks, expanded secret columns and VOLATILE admin functions refused before anything runs), `SET TRANSACTION READ ONLY`, timeout, and column redaction. [Learn about the security model →](...
No parameter schema in public metadata yet.
rails_read_logsReverse file tail with level filtering and sensitive data redaction. A value an SQL statement holds inline is filtered when the column it meets is a secret, and so are the values a database error repeats ([Redaction](SECURITY.md#redaction)).
Reverse file tail with level filtering and sensitive data redaction. A value an SQL statement holds inline is filtered when the column it meets is a secret, and so are the values a database error repeats ([Redaction](SECURITY.md#redaction)).
No parameter schema in public metadata yet.
rails_diagnoseOne-call error diagnosis with classification, context, recent git changes, and log correlation. It does not call a method undefined when the model's method list could be missing one - a concern's, a parent's, or anything past the payload's own cap.
One-call error diagnosis with classification, context, recent git changes, and log correlation. It does not call a method undefined when the model's method list could be missing one - a concern's, a parent's, or anything past the payload's own cap.
No parameter schema in public metadata yet.
rails_review_changesPR/commit review with per-file context and warnings.
PR/commit review with per-file context and warnings.
No parameter schema in public metadata yet.
rails_runtime_infoLive database pool stats, table sizes, pending migrations, cache stats, queue depth.
Live database pool stats, table sizes, pending migrations, cache stats, queue depth.
No parameter schema in public metadata yet.
rails_session_contextSession-aware context tracking across tool calls within a conversation. Pass `action` or `mark`; a call with neither is an error. A conversation's record keeps its latest 200 queries, and `status` and `summary` say how many older ones it dropped; a param longer than 80 charact...
Session-aware context tracking across tool calls within a conversation. Pass `action` or `mark`; a call with neither is an error. A conversation's record keeps its latest 200 queries, and `status` and `summary` say how many older ones it dropped; a param longer than 80 charact...
No parameter schema in public metadata yet.
Sponsors
Readme
Details
- Repository
- github.com/crisnahine/rails-ai-context
- Website
- crisnahine.github.io/rails-ai-context
- Package
https://github.com/crisnahine/rails-ai-context/releases/download/v5.39.1/rails-ai-context-mcp.mcpb- Transport
- STDIO
- Registry
- MCP registry, active