MCP Ruby Framework

v1.0.0Developer Toolsstable

A lightweight Ruby framework for building MCP servers with a Sinatra-like DSL

mcp-servermodelcontextprotocol
Share:
205
Stars
0
Downloads
0
Weekly
0/5

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

Build MCP servers using lightweight Ruby DSL.
Create Sinatra-like MCP server implementations.
Rapidly develop Ruby-based MCP integrations.
funwarioisii

Maintainer

LicenseMIT
Languageruby
Versionv1.0.0
UpdatedMay 6, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx mcp-rb

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 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
1

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 install
2

Define 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]}!" }
end
3

Define 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(", ") }
end
4

Configure 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"]
    }
  }
}
5

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.rb

MCP 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.

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-rb": { "command": "npx", "args": ["-y", "mcp-rb"] } } }

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

Read the full setup guide →

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.

33,000+ ServersFree & Open SourceStep-by-Step Guides