Rails AI Context

v5.10.0Coding Agentsstable

38 MCP tools that give AI agents live access to your Rails schema, models, routes & conventions. Works with Claude Code, Cursor, Copilot, OpenCode, Codex CLI. Zero config.

aiai-codingclaudecodexcodex-cli
Share:
142
Stars
0
Downloads
0
Weekly
0/5

What is Rails AI Context?

Rails AI Context is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to 38 mcp tools that give ai agents live access to your rails schema, models, routes & conventions. works with claude code, cursor, copilot, opencode, codex cli. zero config.

38 MCP tools that give AI agents live access to your Rails schema, models, routes & conventions. Works with Claude Code, Cursor, Copilot, OpenCode, Codex CLI. Zero config.

This server falls under the Coding Agents category on MCPgee, the world's largest MCP server directory with 33,000+ servers.

Features

  • 38 MCP tools that give AI agents live access to your Rails s

Use Cases

Access Rails schema and models from AI agents
Query routes and conventions in real-time
Enable AI-powered Ruby on Rails development
crisnahine

Maintainer

LicenseMIT
Languageruby
Versionv5.10.0
UpdatedMay 21, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx rails-ai-context

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

How to Set Up and Use Rails AI Context

Rails AI Context is a Ruby gem that provides 38 MCP tools giving AI assistants live, verified access to a Rails application's schema, models, routes, controllers, views, and coding conventions. Instead of guessing at column names, association names, or test patterns, the AI calls tools like rails_get_schema, rails_model_details, or rails_search_code and receives ground-truth data extracted via Prism AST parsing — each result tagged [VERIFIED] or [INFERRED] so the AI knows what to trust. It works with Claude Code, Cursor, GitHub Copilot, OpenCode, and Codex CLI with zero manual configuration after installation.

Prerequisites

  • Ruby 3.2, 3.3, or 3.4 installed
  • Rails 7.1, 7.2, or 8.0 application
  • Bundler for gem management
  • An MCP-compatible AI coding tool such as Claude Code or Cursor
  • The rails-ai-context gem added to your Gemfile (development group)
1

Add the gem to your Gemfile

Add rails-ai-context to the development group in your Rails application's Gemfile.

gem "rails-ai-context", group: :development
2

Install the gem

Run bundle install to fetch and install the gem and its dependencies.

bundle install
3

Run the install generator

The generator creates the MCP configuration file and sets up per-AI-tool config files that are auto-detected when you open the project in a supported IDE.

rails generate rails_ai_context:install
4

Start the MCP server

Launch the stdio MCP server that AI tools connect to. The server exposes all 38 tools over the MCP protocol.

rails ai:serve
5

Alternative: standalone usage without Gemfile

Install the gem globally and use it on any Rails project without modifying its Gemfile.

gem install rails-ai-context
cd your-rails-app
rails-ai-context init
rails-ai-context serve
6

Verify tools from the CLI

Test individual tools from the command line before wiring up the MCP client to confirm the server can read your schema and models.

rails 'ai:tool[schema]' table=users
rails 'ai:tool[model_details]' model=User
rails 'ai:tool[search_code]' pattern=publishable? match_type=trace

Rails AI Context Examples

Client configuration

Claude Desktop configuration for the Rails AI Context MCP server using the Rails CLI to start the server process.

{
  "mcpServers": {
    "rails-ai-context": {
      "command": "bundle",
      "args": ["exec", "rails", "ai:serve"],
      "cwd": "/absolute/path/to/your-rails-app",
      "env": {
        "RAILS_ENV": "development"
      }
    }
  }
}

Prompts to try

Example prompts that trigger Rails AI Context tools to give the AI verified information about your application.

- "What columns does the users table have? Check the live schema."
- "Show me all associations and scopes defined on the User model"
- "Trace every place the publishable? method is called in the codebase"
- "What routes are defined for the OrdersController?"

Troubleshooting Rails AI Context

rails ai:serve fails with LoadError or uninitialized constant

Ensure RAILS_ENV=development and that the gem is in the development group in Gemfile. Run 'bundle exec rails ai:serve' (with bundle exec) to ensure the gem is loaded from the correct Gemfile context.

Schema tool returns empty results or wrong columns

The schema tool reads db/schema.rb or structure.sql. Run 'rails db:schema:dump' to regenerate the schema file if it's out of date, then retry the tool.

AI client shows 'server not found' after configuration

The 'cwd' path in the MCP config must be the absolute path to the Rails application root (where Gemfile lives). Also confirm 'rails ai:serve' runs without errors in that directory before connecting the AI client.

Frequently Asked Questions about Rails AI Context

What is Rails AI Context?

Rails AI Context is a Model Context Protocol (MCP) server that 38 mcp tools that give ai agents live access to your rails schema, models, routes & conventions. works with claude code, cursor, copilot, opencode, codex cli. zero config. It connects AI assistants to external tools and data sources through a standardized interface.

How do I install Rails AI Context?

Follow the installation instructions on the Rails AI Context GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.

Which AI clients work with Rails AI Context?

Rails AI Context works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.

Is Rails AI Context free to use?

Yes, Rails AI Context is open source and available under the MIT license. You can use it freely in both personal and commercial projects.

Browse More Coding Agents MCP Servers

Explore all coding agents servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.

Quick Config Preview

{ "mcpServers": { "rails-ai-context": { "command": "npx", "args": ["-y", "rails-ai-context"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

Ready to use Rails AI Context?

Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.

33,000+ ServersFree & Open SourceStep-by-Step Guides