MCP Server

Connect AI agents to Ruby UI components, source, examples, and install commands.

About MCP

MCP (Model Context Protocol) is an open standard for connecting AI assistants to external data sources and tools. Ruby UI exposes an MCP server so your AI agent can list available components, view their source files, search the docs, and generate the exact install command for your app.

Setup

Add the Ruby UI MCP server to your editor or AI client using the snippets below.

Claude Code

claude mcp add --transport http ruby-ui https://rubyui.com/mcp

Cursor

Add to .cursor/mcp.json:

{
  "mcpServers": {
    "ruby-ui": { "url": "https://rubyui.com/mcp" }
  }
}

Claude Desktop

Add to claude_desktop_config.json:

{
  "mcpServers": {
    "ruby-ui": { "url": "https://rubyui.com/mcp" }
  }
}

Windsurf

Add to mcp_config.json:

{
  "mcpServers": {
    "ruby-ui": { "url": "https://rubyui.com/mcp" }
  }
}

VS Code

Add to .vscode/mcp.json:

{
  "mcpServers": {
    "ruby-ui": { "url": "https://rubyui.com/mcp" }
  }
}

Zed

Add to settings.json:

{
  "context_servers": {
    "ruby-ui": { "source": "http", "url": "https://rubyui.com/mcp" }
  }
}

Usage

Once connected, ask your agent questions like:

  • Install Button and Dialog from Ruby UI.
  • Show me the source of the Card component.
  • Search Ruby UI for a date input.
  • Audit my Ruby UI install.

Tools

The MCP server exposes the following tools:

ToolDescription
get_project_registriesLists available registries.
list_items_in_registriesReturns all components with descriptions.
search_items_in_registriesFuzzy search by name, description, or docs.
view_items_in_registriesReturns full source files and dependencies.
get_item_examples_from_registriesReturns code examples per component.
get_add_command_for_itemsReturns a validated rails g ruby_ui:component … command.
get_audit_checklistReturns a post-install verification checklist.
get_install_command_for_projectReturns commands to bootstrap ruby_ui in a fresh Rails project.

Troubleshooting

  • Endpoint must be reachable; corporate proxies may block streamable HTTP.
  • If the agent can't find components, ask it to call get_project_registries first.
  • Run bundle exec rails g ruby_ui:component <Name> only inside a Rails app with ruby_ui in its Gemfile.