MCP Ruby Framework
A lightweight Ruby framework for building MCP servers with a Sinatra-like DSL
What is MCP Ruby Framework?
MCP Ruby Framework is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to lightweight ruby framework for building mcp servers with a sinatra-like dsl
A lightweight Ruby framework for building MCP servers with a Sinatra-like DSL
This server falls under the Developer Tools category on MCPgee, the world's largest MCP server directory with 33,000+ servers.
Features
- A lightweight Ruby framework for building MCP servers with a
Use Cases
Maintainer
Works with
Installation
Manual Installation
npx mcp-rbConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
How to Set Up and Use MCP Ruby Framework
mcp-rb is a lightweight Ruby gem that lets developers build MCP servers using a concise Sinatra-inspired DSL, making it easy to expose Ruby code as tools and resources to AI assistants without writing protocol boilerplate. You define tools with typed arguments and resources with URI templates in just a few lines of Ruby, and the framework handles the MCP wire protocol, stdio transport, and input validation automatically. It is aimed at Ruby developers who want to integrate their existing Ruby services or libraries into Claude Desktop or any other MCP-compatible client with minimal setup.
Prerequisites
- Ruby 2.7 or later installed
- Bundler installed (gem install bundler)
- An MCP client such as Claude Desktop
- Basic familiarity with Ruby and Gemfiles
- Node.js and npx available if using the MCP Inspector for testing
Add mcp-rb to your Gemfile
Add the mcp-rb gem to your project's Gemfile and run bundle install to fetch it.
# Gemfile
gem 'mcp-rb'
# Then install:
bundle installDefine resources using the DSL
Create a Ruby script that defines resources with static URIs or URI templates. Resources represent readable data that AI assistants can request.
require 'mcp-rb'
resource "hello://world" do
name "Hello World"
description "A simple hello world message"
call { "Hello, World!" }
end
resource_template "hello://{user_name}" do
call { |args| "Hello, #{args[:user_name]}!" }
endDefine tools using the DSL
Tools are callable actions with typed, optionally required arguments. Define them in the same script or in separate files.
tool "greet" do
description "Greet someone by name"
argument :name, String, required: true
call { |args| "Hello, #{args[:name]}!" }
end
tool "group_greeting" do
description "Greet multiple people"
argument :people, Array, required: true, items: String
call { |args| args[:people].map { |p| "Hello, #{p}!" }.join(", ") }
endConfigure Claude Desktop
Edit claude_desktop_config.json to register your Ruby MCP server script. Claude Desktop will launch the script as a child process using the Ruby executable.
{
"mcpServers": {
"my-ruby-mcp": {
"command": "ruby",
"args": ["/absolute/path/to/your_server.rb"]
}
}
}Test with the MCP Inspector
Use the Model Context Protocol Inspector to interactively test your server before connecting it to Claude Desktop.
bunx @modelcontextprotocol/inspector $(pwd)/examples/hello_world.rbMCP Ruby Framework Examples
Client configuration
claude_desktop_config.json entry that launches a local Ruby MCP server script built with mcp-rb.
{
"mcpServers": {
"my-ruby-mcp": {
"command": "ruby",
"args": ["/Users/yourname/projects/my_mcp_server.rb"]
}
}
}Prompts to try
Example prompts to exercise tools and resources defined in a mcp-rb server.
- "Greet Alice using the greet tool."
- "Say hello to Bob, Carol, and Dave using the group_greeting tool."
- "Read the hello://world resource."
- "What tools and resources are available on this server?"Troubleshooting MCP Ruby Framework
Claude Desktop cannot start the Ruby server — 'command not found: ruby'
Specify the full path to the Ruby executable in the command field, e.g. '/usr/bin/ruby' or '/Users/yourname/.rbenv/shims/ruby'. Run 'which ruby' in your terminal to find the correct path.
Tool calls fail with argument type errors
Ensure argument types in the DSL match what you pass. mcp-rb performs type coercion for basic types (String, Integer, Array) but will reject arguments that cannot be coerced. Check the argument definitions and the values Claude is sending.
Missing gem errors at runtime
If your server script requires other gems, run the script with 'bundle exec ruby your_server.rb' and use 'bundle exec' in the command field in claude_desktop_config.json, or ensure all gems are installed in the system gem path.
Frequently Asked Questions about MCP Ruby Framework
What is MCP Ruby Framework?
MCP Ruby Framework is a Model Context Protocol (MCP) server that lightweight ruby framework for building mcp servers with a sinatra-like dsl It connects AI assistants to external tools and data sources through a standardized interface.
How do I install MCP Ruby Framework?
Follow the installation instructions on the MCP Ruby Framework GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.
Which AI clients work with MCP Ruby Framework?
MCP Ruby Framework works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.
Is MCP Ruby Framework free to use?
Yes, MCP Ruby Framework is open source and available under the MIT license. You can use it freely in both personal and commercial projects.
MCP Ruby Framework Alternatives — Similar Developer Tools Servers
Looking for alternatives to MCP Ruby Framework? 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 Ruby Framework 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 Ruby Framework?
Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.