
rails-ai-context
by crisnahine·★ 139·Score 50
38 MCP tools providing AI agents with direct access to Rails app schema, models, routes & conventions.
Overview
rails-ai-context is a comprehensive MCP server designed to eliminate AI guesswork when working with Ruby on Rails applications. It exposes 38 tools that allow AI assistants to query your Rails app's schema, models, routes, controllers, views, and conventions directly, rather than inferring from training data. The server uses Prism AST parsing to provide accurate information with confidence tags indicating whether data is verified or inferred. It integrates seamlessly with popular AI coding assistants like Claude Code, Cursor, GitHub Copilot, and others.
Try asking AI
After installing, here are 7 things you can ask your AI assistant:
When to choose this
Choose this when working with Rails applications and want to reduce AI's guessing game by giving it direct, verified access to your schema, models, and conventions.
When NOT to choose this
Don't choose this if you're not using Rails, or if you need tools that can write or modify code (this server is strictly read-only).
Tools this server exposes
12 tools extracted from the READMEsearch_codeTrace code definitions, sources, callers, and tests
get_schemaGet table columns with indexes, uniqueness, encryption, and defaults
get_model_detailsGet associations, validations, scopes, enums with verification tags
get_controllersGet controller actions, inherited filters, render maps, and strong params
get_routesGet route helpers with required parameters
analyze_featureFull-stack analysis of models, controllers, routes, services, jobs, views, tests
get_viewGet view templates with ivars, Turbo wiring, Stimulus refs, partial locals
get_test_infoGet fixtures, relationships, and test templates matching project patterns
validateRun syntax, semantic, and security (Brakeman) validation
diagnoseOne-call error diagnosis with classification, context, git, and logs
get_frontend_stackGet frontend framework, Hotwire, TypeScript, and package manager info
querySafe read-only SQL with timeout, row limit, and column redaction
Comparable tools
Installation
Installation
Option 1: As a gem (recommended)
gem "rails-ai-context", group: :development
rails generate rails_ai_context:installOption 2: Standalone (no Gemfile needed)
gem install rails-ai-context
cd your-rails-app
rails-ai-context init # interactive setup
rails-ai-context serve # start MCP serverClaude Desktop Configuration
Add to claude_desktop_config.json:
{
"mcpServers": {
"rails-ai-context": {
"command": "rails",
"args": ["ai:serve"],
"env": {}
}
}
}FAQ
- What AI assistants are compatible with rails-ai-context?
- It works with Claude Code, Cursor, GitHub Copilot, OpenCode, Codex CLI, and any terminal-based AI tools through its CLI mode.
- How does the server provide accurate information about my Rails app?
- It uses Prism AST parsing to analyze your codebase directly, providing results marked as [VERIFIED] when data is confirmed and [INFERRED] when requiring runtime checks.
Compare rails-ai-context with
Last updated · Auto-generated from public README + GitHub signals.