- Explore MCP Servers
- mcp-ruby-sdk
Mcp Ruby Sdk
What is Mcp Ruby Sdk
The mcp-ruby-sdk is a Ruby SDK designed for implementing the Model Context Protocol (MCP), enabling developers to create applications that can communicate using this protocol.
Use cases
Use cases for the mcp-ruby-sdk include building interactive calculators, creating dynamic greeting services, and developing applications that require real-time data processing and user interaction.
How to use
To use the mcp-ruby-sdk, add ‘gem “mcp”’ to your application’s Gemfile and run ‘bundle install’. You can also install it directly using ‘gem install mcp’. A simple example of creating an MCP server is provided in the README.
Key features
Key features include full implementation of the MCP specification, support for Resources, Tools, and Prompts, multiple transport options (stdio, HTTP/SSE), easy-to-use high-level interfaces, async/await support, and a comprehensive type system.
Where to use
The mcp-ruby-sdk can be used in various applications that require communication through the Model Context Protocol, such as chatbots, interactive tools, and server-client architectures.
Clients Supporting MCP
The following are the main client software that supports the Model Context Protocol. Click the link to visit the official website for more information.
Overview
What is Mcp Ruby Sdk
The mcp-ruby-sdk is a Ruby SDK designed for implementing the Model Context Protocol (MCP), enabling developers to create applications that can communicate using this protocol.
Use cases
Use cases for the mcp-ruby-sdk include building interactive calculators, creating dynamic greeting services, and developing applications that require real-time data processing and user interaction.
How to use
To use the mcp-ruby-sdk, add ‘gem “mcp”’ to your application’s Gemfile and run ‘bundle install’. You can also install it directly using ‘gem install mcp’. A simple example of creating an MCP server is provided in the README.
Key features
Key features include full implementation of the MCP specification, support for Resources, Tools, and Prompts, multiple transport options (stdio, HTTP/SSE), easy-to-use high-level interfaces, async/await support, and a comprehensive type system.
Where to use
The mcp-ruby-sdk can be used in various applications that require communication through the Model Context Protocol, such as chatbots, interactive tools, and server-client architectures.
Clients Supporting MCP
The following are the main client software that supports the Model Context Protocol. Click the link to visit the official website for more information.
Content
MCP Ruby SDK
Ruby implementation of the Model Context Protocol (MCP).
Installation
Add this line to your application’s Gemfile:
gem 'mcp'
And then execute:
$ bundle install
Or install it yourself as:
$ gem install mcp
Quick Start
Here’s a simple example of creating an MCP server with a calculator tool:
require 'mcp'
# Create an MCP server
server = MCP::Server.new(
name: "Demo",
version: "1.0.0"
)
# Add an addition tool
server.add_tool("add") do |params|
result = params["a"] + params["b"]
{
content: [{ type: "text", text: result.to_s }]
}
end
# Add a dynamic greeting resource
server.add_resource("greeting") do |uri, params|
{
contents: [{
uri: uri,
text: "Hello, #{params['name']}!"
}]
}
end
# Start the server using stdio transport
transport = MCP::Transport::Stdio.new
server.connect(transport)
Features
- Full implementation of the MCP specification
- Support for Resources, Tools, and Prompts
- Multiple transport options (stdio, HTTP/SSE)
- Easy-to-use high-level interfaces
- Async/await support
- Comprehensive type system
Documentation
For detailed documentation, please visit:
Development
After checking out the repo, run bin/setup to install dependencies. Then, run rake spec to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.
Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/modelcontextprotocol/ruby-sdk. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the code of conduct.
License
The gem is available as open source under the terms of the MIT License.
Dev Tools Supporting MCP
The following are the main code editors that support the Model Context Protocol. Click the link to visit the official website for more information.










