Getting started

  1. Install
  2. Connect your agent
    1. Cursor
    2. Claude Code
    3. Codex
    4. Claude Desktop and other MCP clients
    5. Installed with bundle add
  3. Add the agent skill (optional)
  4. Check it works

Install

gem install rails-agent-kit

or, inside your Rails app:

bundle add rails-agent-kit --group development

rails-agent-kit needs Ruby 3.2 or newer. It reads the app in the directory you pass with --root. In every example below, replace /path/to/your/rails/app with the absolute path to your app.

Connect your agent

Cursor

.cursor/mcp.json in your app (or ~/.cursor/mcp.json):

{
  "mcpServers": {
    "rails-agent-kit": {
      "command": "rails-agent-kit",
      "args": ["--root", "/path/to/your/rails/app"]
    }
  }
}

Claude Code

claude mcp add rails-agent-kit -- rails-agent-kit --root /path/to/your/rails/app

Codex

codex mcp add rails-agent-kit -- rails-agent-kit --root /path/to/your/rails/app

or in ~/.codex/config.toml:

[mcp_servers.rails-agent-kit]
command = "rails-agent-kit"
args = ["--root", "/path/to/your/rails/app"]

Claude Desktop and other MCP clients

Any client that launches stdio MCP servers works. Claude Desktop’s claude_desktop_config.json takes the same mcpServers block as Cursor.

Installed with bundle add

Run it through the app’s bundle:

{
  "mcpServers": {
    "rails-agent-kit": {
      "command": "bundle",
      "args": ["exec", "rails-agent-kit", "--root", "/path/to/your/rails/app"],
      "env": { "BUNDLE_GEMFILE": "/path/to/your/rails/app/Gemfile" }
    }
  }
}
claude mcp add rails-agent-kit -e BUNDLE_GEMFILE=/path/to/your/rails/app/Gemfile \
  -- bundle exec rails-agent-kit --root /path/to/your/rails/app

Add the agent skill (optional)

rails-agent-kit install-skills --root /path/to/your/rails/app                 # Cursor
rails-agent-kit install-skills --root /path/to/your/rails/app --agent claude  # Claude Code

See Agent skill for what it does.

Check it works

Ask your agent something like “Which columns does the users table have?” or “What’s the route helper for creating a comment?”. It should call rails_schema or rails_routes instead of guessing.

If routes come back with routes_unavailable: true, the app couldn’t boot. See Routes without booting.