mcp-rb
A lightweight Ruby framework for building MCP servers with a Sinatra-like DSL
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:
- Install Bundler if you don't have it: gem install bundler
- Add the mcp-rb gem to your Gemfile: gem 'mcp-rb' Or install directly: gem install mcp-rb
- If you use Bundler, install dependencies: bundle install
- 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
web-eval-agent
An MCP server that autonomously evaluates web applications.
ros
Connect AI models like Claude & GPT with robots using MCP and ROS.
OmniFocus
Let LLMs interface with your tasks and projects through the Model Context Protocol. Add, organize, and query your OmniFocus database with natural language commands.
fhir
FHIR MCP Server – helping you expose any FHIR Server or API as a MCP Server.
unitree-go2
The Unitree Go2 MCP Server is a server built on the MCP that enables users to control the Unitree Go2 robot using natural language commands interpreted by a LLM.
time
⏰ Time MCP Server: Giving LLMs Time Awareness Capabilities