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/mcpCursor
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:
| Tool | Description |
|---|---|
| get_project_registries | Lists available registries. |
| list_items_in_registries | Returns all components with descriptions. |
| search_items_in_registries | Fuzzy search by name, description, or docs. |
| view_items_in_registries | Returns full source files and dependencies. |
| get_item_examples_from_registries | Returns code examples per component. |
| get_add_command_for_items | Returns a validated rails g ruby_ui:component … command. |
| get_audit_checklist | Returns a post-install verification checklist. |
| get_install_command_for_project | Returns 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.