
Write HTML. Render video. Built for agents.
MCP-RB gives you a Ruby DSL for building MCP servers that expose resources, resource templates, and tools. It follows the MCP 2024-11-05 spec and supports stdio transport plus basic server methods like `ping`, `resources/list`, and `tools/call`.
Builders who want to create MCP servers in Ruby for agents and other MCP clients.
You can package Ruby logic as MCP resources and tools that an agent can call.
Define server name, version, resources, templates, and tools with a small Ruby DSL.
Expose static resources and parameterized resource templates with `resource` and `resource_template` blocks.
Create callable tools with typed arguments, required fields, and nested argument structures.
Implements the base protocol, stdio transport, and server features listed in the 2024-11-05 spec.
Includes sample servers in `examples/` and unit and integration tests in `test/`.
rake test rake test:unit # run only the unit tests, skipping tests that test a running server
bunx @modelcontextprotocol/inspector $(pwd)/examples/hello_world.rb
bundle exec standardrb --fix
rake lint # Run standardrb to check code style rake lint:fix # Auto-fix standardrb issues
git add . git commit -m "Release vx.y.z" git tag vx.y.z git push --tags
gem build mcp-rb.gemspec gem push mcp-rb-*.gem
A lightweight Ruby framework for implementing MCP (Model Context Protocol) servers with a Sinatra-like DSL.
Add this line to your application's Gemfile:
gem 'mcp-rb'
Here's a simple example of how to create an MCP server:
require 'mcp'
name "hello-world"
version "1.0.0"
# Define a resource
resource "hello://world" do
name "Hello World"
description "A simple hello world message"
call { "Hello, World!" }
end
# Define a resource template
resource_template "hello://{user_name}" do
name "Hello User"
description "A simple hello user message"
call { |args| "Hello, #{args[:user_name]}!" }
end
# Define a tool
tool "greet" do
description "Greet someone by name"
argument :name, String, required: true, description: "Name to greet"
call do |args|
"Hello, #{args[:name]}!"
end
end
# Define a tool with nested arguments
tool "greet_full_name" do
description "Greet someone by their full name"
argument :person, required: true, description: "Person to greet" do
argument :first_name, String, required: false, description: "First name"
argument :last_name, String, required: false, description: "Last name"
end
call do |args|
"Hello, First: #{args[:person][:first_name]} Last: #{args[:person][:last_name]}!"
end
end
# Define a tool with an Array argument
tool "group_greeting" do
description "Greet multiple people at once"
argument :people, Array, required: true, items: String, description: "People to greet"
call do |args|
args[:people].map { |person| "Hello, #{person}!" }.join(", ")
end
end
Reference: MCP 2024-11-05
Any capabilities are not supported yet.
rake test
rake test:unit # run only the unit tests, skipping tests that test a running server
Test with MCP Inspector
bunx @modelcontextprotocol/inspector $(pwd)/examples/hello_world.rb
bundle exec standardrb --fix
You can also use rake tasks:
rake lint # Run standardrb to check code style
rake lint:fix # Auto-fix standardrb issues
To release a new version:
lib/mcp/version.rbCHANGELOG.mdgit add .
git commit -m "Release vx.y.z"
git tag vx.y.z
git push --tags
gem build mcp-rb.gemspec
gem push mcp-rb-*.gem
See CHANGELOG.md
Sign in to join the discussion.
No comments yet. Be the first to say what this is good for.

Write HTML. Render video. Built for agents.
Ultra-lightweight, open-source, self-hosted personal AI agent framework in Python with WebUI, tools, memory, MCP, multi-agent workflows, automation, and chat apps
SkillOpt is a text-space optimizer that trains reusable natural-language skills for frozen LLM agents through trajectory-driven edits, validation-gated updates, and deployable best_skill.md artifacts.

Omnigent is an open-source AI agent framework and meta-harness: orchestrate Claude Code, Codex, Cursor, Pi, and custom agents — swap harnesses without rewriting, enforce policies and sandboxing, and collaborate in real time from any device.
A theoretical reconstruction of the Claude Mythos architecture, built from first principles using the available research literature.
🕷️ An adaptive Web Scraping framework that handles everything from a single request to a full-scale crawl!