Get the FREE Ultimate OpenClaw Setup Guide →

mcp-rb

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

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio funwarioisii-mcp-rb bundle exec mcp-rb \
  --env RAILS_ENV="production" \
  --env BUNDLE_WITHOUT="development:test"

How to use

mcp-rb is a Ruby-based MCP server built with a Sinatra-like DSL for defining resources, resource templates, and tools. The server lets you declare resources (endpoints or contexts that return data) and tools (actions that operate on inputs) in Ruby code, and then expose them over the MCP protocol for other components to query or invoke. Typical usage involves writing a Ruby script that requires the mcp-rb library, defines a few resources and tools using the provided DSL, and then runs the server to listen for MCP requests. The README demonstrates defining a simple hello world resource, a parameterized resource template, and a couple of tools (one simple greeting tool and one with nested arguments). The server supports core MCP capabilities such as resources read/list and templates, as well as tools list and tools call, consistent with the MCP specification referenced in the docs.

How to install

Prerequisites:

  • Ruby (2.7 or newer) and Bundler installed on your system
  • Access to RubyGems or a network connection to fetch gems

Installation steps:

  1. Install Bundler if you don't have it: gem install bundler
  2. Add the mcp-rb gem to your Gemfile: gem 'mcp-rb' Or install directly: gem install mcp-rb
  3. If you use Bundler, install dependencies: bundle install
  4. Run the MCP Rb server (example): bundle exec mcp-rb This will start the MCP server using the bundled executable provided by the gem. Ensure your environment is configured for running Ruby applications (PATH, GEM_HOME, etc.).

Optional: for development you can install the gem from source and run the server with a local script that loads the library and starts the MCP server.

Additional notes

Tips and notes:

  • This MCP server is implemented in Ruby as mcp-rb and uses a DSL to declare resources, templates, and tools. The examples show common patterns for greeting resources and parameterized templates.
  • Ensure your environment variables (like BUNDLE_WITHOUT or GEM paths) are set appropriately for your deployment environment.
  • The MCP protocol support includes resources/read, resources/list, resources/templates/list, tools/list, and tools/call. There is no indication of additional capabilities in the current README, so plan integration accordingly.
  • When deploying, consider using Bundler groups to separate development/test dependencies from production to minimize the deployed footprint.
  • If you encounter issues starting the server, verify that the mcp-rb gem is installed and that the bin/ or executable path is accessible via bundle exec mcp-rb, and consult your Ruby version compatibility with the gem.

Related MCP Servers

Sponsor this space

Reach thousands of developers