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.
MCP-RB is a lightweight Ruby framework designed for implementing Model Context Protocol (MCP) servers, utilizing a Sinatra-like DSL for simplified development.
To incorporate MCP-RB into your Ruby application, add gem 'mcp-rb' to your Gemfile.
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.
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.
The framework includes testing capabilities via rake test, with options to run unit tests only. It also supports testing with MCP Inspector.
Code formatting is managed using standardrb, with rake tasks for checking and auto-fixing code style.
The release process involves updating the version, changelog, creating a git tag, and pushing the gem to RubyGems.
See CHANGELOG.md
funwarioisii/mcp-rb
February 12, 2025
March 28, 2025
Ruby