MCP on Ruby

v1.0.0โ€ขDeveloper Toolsโ€ขstable

๐Ÿ’Ž A Ruby implementation of the Model Context Protocol

aianthropiclarge-language-modelsmcpmodel-context-protocol
Share:
98
Stars
0
Downloads
0
Weekly
0/5

What is MCP on Ruby?

MCP on Ruby is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to ๐Ÿ’Ž a ruby implementation of the model context protocol

๐Ÿ’Ž A Ruby implementation of the Model Context Protocol

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

Features

  • ๐Ÿ’Ž A Ruby implementation of the Model Context Protocol

Use Cases

Ruby MCP implementation
Ruby agent development
Protocol standardization
nagstler

Maintainer

LicenseMIT
Languageruby
Versionv1.0.0
UpdatedMay 1, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx mcp-on-ruby

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 MCP on Ruby

MCP on Ruby is a production-ready Ruby gem that brings Model Context Protocol support to Rails applications. Rather than being a standalone MCP server, it is a framework gem that lets Rails developers expose their own application's data and logic to AI assistants by defining MCP tools and resources using a familiar Rails-style DSL. It includes Rails generators, Railtie integration, JSON Schema validation, token authentication, rate limiting, DNS rebinding protection, and an HTTP transport โ€” making it the canonical way to build MCP servers in the Rails ecosystem.

Prerequisites

  • Ruby 2.7 or later
  • A Rails application (Rails 6+)
  • Bundler for dependency management
  • An MCP-compatible client to test against (Claude Desktop, Cursor, etc.)
  • Optional: MCP_AUTH_TOKEN environment variable for securing the endpoint
1

Add mcp_on_ruby to your Gemfile

Add the gem to your Rails application's Gemfile and run bundle install.

gem 'mcp_on_ruby'
# then run:
bundle install
2

Run the install generator

The generator creates the initializer, application tool base class, and application resource base class, and mounts the MCP endpoint in your routes.

rails generate mcp_on_ruby:install
3

Configure the MCP server

Edit the generated initializer to set authentication, rate limiting, and allowed origins for your environment.

# config/initializers/mcp_on_ruby.rb
McpOnRuby.configure do |config|
  config.authentication_required = true
  config.authentication_token = ENV['MCP_AUTH_TOKEN']
  config.rate_limit_per_minute = 60
  config.allowed_origins = [/\.yourdomain\.com$/]
end
4

Generate a tool

Use the tool generator to scaffold a new MCP tool class. Implement the execute method with your application logic and define the input schema.

rails generate mcp_on_ruby:tool UserManager --description "Manage application users"
5

Start Rails and connect your MCP client

Start the Rails server. The MCP endpoint is available at http://localhost:3000/mcp. Connect your MCP client to this URL using the HTTP transport.

rails server
# MCP endpoint: http://localhost:3000/mcp

MCP on Ruby Examples

Client configuration

Cursor mcp.json configuration connecting to a local Rails MCP server via HTTP.

{
  "mcpServers": {
    "my-rails-app": {
      "url": "http://localhost:3000/mcp"
    }
  }
}

Prompts to try

Once you have defined tools for your Rails app, prompts depend on what you expose. These are representative examples for a user management tool.

- "List all users in the system"
- "Create a new user account for [email protected]"
- "Show me the statistics for user ID 42"
- "What tools are available in this Rails application?"
- "Update the role of user 7 to admin"

Troubleshooting MCP on Ruby

DNS rebinding protection blocks MCP client connections

Add your client's origin to the allowed_origins configuration in the initializer. For local development, you may set allowed_origins to [/.*/] temporarily, but restrict this in production.

Authentication errors when connecting from MCP client

If authentication_required is true, the client must send the MCP_AUTH_TOKEN as a Bearer token in the Authorization header. Check your client's documentation for how to add custom headers to MCP requests.

Generated tools are not appearing in the MCP tool list

Ensure auto_register_tools is set to true in your Rails config, and that the tool file is in app/tools/ where Rails autoloading can find it. Restart the Rails server after adding new tool files.

Frequently Asked Questions about MCP on Ruby

What is MCP on Ruby?

MCP on Ruby is a Model Context Protocol (MCP) server that ๐Ÿ’Ž a ruby implementation of the model context protocol It connects AI assistants to external tools and data sources through a standardized interface.

How do I install MCP on Ruby?

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

Which AI clients work with MCP on Ruby?

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

Is MCP on Ruby free to use?

Yes, MCP on Ruby is open source and available under the MIT license. You can use it freely in both personal and commercial projects.

Browse More Developer Tools MCP Servers

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

Quick Config Preview

{ "mcpServers": { "mcp-on-ruby": { "command": "npx", "args": ["-y", "mcp-on-ruby"] } } }

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

Read the full setup guide โ†’

Ready to use MCP on Ruby?

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