MCP-RB is a lightweight Ruby framework for building MCP servers using a Sinatra-like DSL. It supports defining resources, resource templates, and tools with arguments, adhering to the MCP 2024-11-05 specification.

154
6

MCP-RB

MCP-RB is a lightweight Ruby framework designed for implementing Model Context Protocol (MCP) servers, utilizing a Sinatra-like DSL for simplified development.

Installation

To incorporate MCP-RB into your Ruby application, add gem 'mcp-rb' to your Gemfile.

Usage

The framework allows defining resources, resource templates, and tools. Resources are defined with a name, description, and a call block that returns a value. Resource templates enable dynamic resource creation based on input. Tools are defined with descriptions, arguments (including nested arguments and arrays), and a call block that processes arguments.

Supported specifications

It supports the MCP specification [2024-11-05], including the Base Protocol (ping, stdio transport) and Server features (resources/read, resources/list, resources/templates/list, tools/list, tools/call). Capabilities are not yet supported.

Testing

The framework includes testing capabilities via rake test, with options to run unit tests only. It also supports testing with MCP Inspector.

Formatting

Code formatting is managed using standardrb, with rake tasks for checking and auto-fixing code style.

Release

The release process involves updating the version, changelog, creating a git tag, and pushing the gem to RubyGems.

Changelog

See CHANGELOG.md

Repository

FU
funwarioisii

funwarioisii/mcp-rb

Created

February 12, 2025

Updated

March 28, 2025

Language

Ruby

Category

Developer Tools