Rails Blocks MCP

The Rails Blocks MCP server lets AI coding agents discover docs, inspect examples, and install components through the Rails Blocks CLI. It runs locally in your editor and keeps free component reads on the public static registry.

How it works

  1. 1. Your AI assistant asks: Cursor, Claude, or another MCP app asks Rails Blocks for help.
  2. 2. Rails Blocks runs locally: The MCP server runs on your computer with the rails-blocks CLI.
  3. 3. Free components are public: Free components come from the public Rails Blocks registry.
  4. 4. Pro components require a token: Pro components use your Rails Blocks access token.

Install

Install both the CLI and MCP package. The MCP server expects the rails-blocks executable to be available on your path.

Terminal
gem install rails-blocks-cli
npm install -g @rails-blocks/mcp
Terminal
gem install rails-blocks-cli
yarn global add @rails-blocks/mcp

Configure your MCP client

Add the Rails Blocks MCP server to your client configuration. If your CLI executable is not on the default path, set RAILS_BLOCKS_CLI.

mcp.json
{
  "mcpServers": {
    "rails-blocks": {
      "command": "rails-blocks-mcp",
      "env": {
        "RAILS_BLOCKS_CLI": "rails-blocks",
        "RAILS_BLOCKS_API_TOKEN": "rb_your_pro_token"
      }
    }
  }
}

Available tools

rails_blocks_list_components
List all, free, or Pro components from the registry.
rails_blocks_search_docs
Find relevant components by name or keyword.
rails_blocks_get_docs
Fetch free or Pro docs, depending on token access.
rails_blocks_get_examples
Return usage examples for a component.
rails_blocks_install_component
Install a component. Agents should dry-run first unless you explicitly approve writes.

Authorize Pro access

Pro access is handled with access tokens. Run the CLI login once, approve the code in your browser or email, then your MCP server can use Pro docs and packages without sharing your password or browser session.

Sign in to authorize Pro access

The MCP server works with free public components without a token. Sign in with a Pro account to let MCP access Pro docs, examples, and installs.

Terminal
rails-blocks login
rails-blocks login --email you@example.com
rails-blocks doctor

Prefer not to store a token in your MCP config? Use rails-blocks login once instead. The CLI stores the approved token locally in ~/.rails_blocks/config.json, and the MCP server reuses it.

Table of contents

Get notified when new components come out