# Rails AI Context

> Let AI coding agents query your Rails app's real structure.

- **URL**: https://followmcp.com/en/servers/rails-ai-context
- **Category**: Dev Tools
- **Origin**: Community
- **Stars**: 192
- **FMRS Score**: 66/100 (Grade C)
- **Source**: https://github.com/crisnahine/rails-ai-context
- **Transports**: stdio (local process)
- **Runtimes**: Prebuilt binary 3.1+
- **Auth**: No credential needed

## Overview
Rails AI Context is a Ruby gem offering 35 read-only MCP tools and CLI commands to help coding agents understand an app's schema, models, routes, controllers, views, test setup, and conventions. It supports MCP over stdio and can also be used through the CLI. When an app cannot boot, some tools can fall back to static analysis and mark runtime data that is unavailable from static sources.

## Best for
- Developers and teams who want AI coding agents to understand their actual Rails app structure.
- Ruby on Rails projects that need read-only app context through MCP or CLI.

## Not for
- Users who need tools to modify application code or the database directly.
- Teams that require tool calls to automatically enforce verification rules on the AI assistant.
- Rails 9 projects; the supplied material says Rails 9 is unsupported.

## Required permissions
- Tools run locally and can read project source, schema, routes, and related information in the app process or a child process.
- The query tool permits restricted read-only SQL operations in a read-only transaction and requires database availability.
- Installation writes MCP configuration, context files, rules files, configuration, and .gitignore entries to the repository.

## Risks
- Some runtime information is unavailable in static mode; answers mark the static tier or unavailable content.
- Read-only tools do not change code or the database, but an AI assistant may still act on their answers; the rules do not enforce its behavior.
- The HTTP server rejects requests outside development and test by default; if production access is enabled, the endpoint has no authentication of its own.
- Calling search_docs with fetch enabled retrieves Rails guides from GitHub.

## Tools (35)
- `search_code`: Search code; trace mode shows a method definition, callers, and test references.
- `get_edit_context`: Get app context relevant to an editing target.
- `analyze_feature`: Analyze a feature and its related code in the app.
- `get_context`: Get application context.
- `onboard`: Summarize the app's structure and configuration.
- `get_schema`: Read database tables, columns, indexes, and associated models.
- `get_model_details`: Read model associations, validations, scopes, enums, and callbacks.
- `get_callbacks`: Read callback information.
- `get_concern`: Read a concern and its related methods.
- `get_controllers`: Read controller actions, inherited filters, and strong parameters.
- `get_routes`: Read application routes.
- `get_view`: Read view information.
- `get_stimulus`: Read Stimulus frontend information.
- `get_partial_interface`: Read a partial's interface information.
- `get_turbo_map`: Read the Turbo map.
- `get_test_info`: Read test framework and setup information.
- `generate_test`: Generate test content using application context.
- `validate`: Validate application-related information.
- `security_scan`: Run a security scan; Brakeman is an optional dependency.
- `performance_check`: Check for performance-related issues.
- `get_config`: Read app configuration, dependencies, and conventions.
- `get_helper_methods`: Read helper methods.
- `get_service_pattern`: Read service pattern information.
- `get_job_pattern`: Read job pattern information.
- `get_component_catalog`: Read the component catalog.
- `get_mailers`: Read mailer information.
- `dependency_graph`: Read dependency graph information.
- `migration_advisor`: Provide migration-related analysis.
- `search_docs`: Search Rails documentation; when fetch is enabled, it retrieves guides from GitHub.
- `query`: Run restricted, read-only SQL queries.
- `read_logs`: Read logs; output is redacted.
- `diagnose`: Diagnose application status.
- `review_changes`: Review code changes.
- `runtime_info`: Read runtime information.
- `session_context`: Read session context.
