MCP on Ruby
๐ A Ruby implementation of the Model Context Protocol
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
Maintainer
Works with
Installation
Manual Installation
npx mcp-on-rubyConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
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
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 installRun 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:installConfigure 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$/]
endGenerate 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"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/mcpMCP 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.
MCP on Ruby Alternatives โ Similar Developer Tools Servers
Looking for alternatives to MCP on Ruby? Here are other popular developer tools servers you can use with Claude, Cursor, and VS Code.
Ecc
โ 188.2kThe agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.
Javaguide
โ 155.8kJava ้ข่ฏ & ๅ็ซฏ้็จ้ข่ฏๆๅ๏ผ่ฆ็่ฎก็ฎๆบๅบ็กใๆฐๆฎๅบใๅๅธๅผใ้ซๅนถๅใ็ณป็ป่ฎพ่ฎกไธ AI ๅบ็จๅผๅ
Gemini CLI
โ 104.5kA secure MCP server that wraps the Google Gemini CLI, allowing clients to query Gemini models using local OAuth sessions without requiring an API key. It provides tools for model interaction and diagnostics with built-in protection against command in
Awesome MCP Servers
โ 87.3kโญ Curated list of Model Context Protocol (MCP) servers - tools that extend Claude Desktop, Cursor, Windsurf, and other MCP clients with custom capabilities.
MCP Servers
โ 86.0kModel Context Protocol Servers
CC Switch
โ 77.5kA cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Gemini CLI & Hermes Agent. Only official website: ccswitch.io
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.
Set Up MCP on Ruby in Your Editor
Choose your AI client for step-by-step setup instructions.
Quick Config Preview
Add this to your claude_desktop_config.json or .cursor/mcp.json
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.