Ruby SDK for Model Context Protocol servers and clients
Top 80.9% on sourcepulse
This Ruby SDK implements the Model Context Protocol (MCP), enabling developers to build clients and servers for AI-powered applications. It facilitates communication for tools, prompts, and resources, offering a structured way to integrate LLM capabilities into Ruby applications.
How It Works
The SDK provides an MCP::Server
class that acts as the central hub for handling JSON-RPC requests and responses according to the MCP specification. It supports various transports like HTTP (with Server-Sent Events for notifications) and stdio. Key functionalities include managing tool and prompt registration, invoking tools, retrieving resources, and sending real-time notifications when lists of tools, prompts, or resources change.
Quick Start & Requirements
gem 'mcp'
and bundle install
.gem install mcp
.Highlighted Details
define
methods, with support for input schemas and annotations.Maintenance & Community
Maintained in collaboration with Shopify. Releases are automated via GitHub Actions upon merging PRs that update the version in lib/mcp/version.rb
.
Licensing & Compatibility
The README does not explicitly state a license. Compatibility for commercial use or closed-source linking is not specified.
Limitations & Caveats
Log level control and resource subscriptions are listed as unsupported features to be implemented in future versions.
2 days ago
Inactive