MCP Catalogs
Homerails-ai-context screenshot

rails-ai-context

by crisnahine·139·Score 50

38 MCP tools providing AI agents with direct access to Rails app schema, models, routes & conventions.

developer-toolsai-llmdatabase
13
Forks
4
Open issues
1 mo ago
Last commit
2d ago
Indexed

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:

you:AI assistants writing Rails code that matches actual schema rather than inventing non-existent columns
you:Generating tests that match your existing patterns (fixtures vs factories)
you:Finding all callers of a method across the codebase to understand impact
you:Analyzing features across models, controllers, views, and tests in one call
you:Understanding view components, Stimulus controllers, and frontend stack conventions
you:What AI assistants are compatible with rails-ai-context?
you:How does the server provide accurate information about my Rails app?

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 README
  • search_code

    Trace code definitions, sources, callers, and tests

  • get_schema

    Get table columns with indexes, uniqueness, encryption, and defaults

  • get_model_details

    Get associations, validations, scopes, enums with verification tags

  • get_controllers

    Get controller actions, inherited filters, render maps, and strong params

  • get_routes

    Get route helpers with required parameters

  • analyze_feature

    Full-stack analysis of models, controllers, routes, services, jobs, views, tests

  • get_view

    Get view templates with ivars, Turbo wiring, Stimulus refs, partial locals

  • get_test_info

    Get fixtures, relationships, and test templates matching project patterns

  • validate

    Run syntax, semantic, and security (Brakeman) validation

  • diagnose

    One-call error diagnosis with classification, context, git, and logs

  • get_frontend_stack

    Get frontend framework, Hotwire, TypeScript, and package manager info

  • query

    Safe read-only SQL with timeout, row limit, and column redaction

Comparable tools

rails-mcpprism-railsruby-ast-tools

Installation

Installation

Option 1: As a gem (recommended)

gem "rails-ai-context", group: :development
rails generate rails_ai_context:install

Option 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 server

Claude 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

GitHub →

Last updated · Auto-generated from public README + GitHub signals.