ruby-sdk  by modelcontextprotocol

Ruby SDK for Model Context Protocol servers and clients

created 5 months ago
348 stars

Top 80.9% on sourcepulse

GitHubView on GitHub
1 Expert Loves This Project
Project Summary

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

  • Install via Bundler: gem 'mcp' and bundle install.
  • Install directly: gem install mcp.
  • Usage examples for HTTP and stdio transports are provided in the README.

Highlighted Details

  • Implements JSON-RPC 2.0, initialization, capability negotiation, tool/prompt/resource management, and notifications.
  • Supports HTTP (SSE) and stdio transports.
  • Allows defining tools and prompts as classes or via define methods, with support for input schemas and annotations.
  • Includes configurable exception reporting and instrumentation callbacks.

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.

Health Check
Last commit

2 days ago

Responsiveness

Inactive

Pull Requests (30d)
27
Issues (30d)
3
Star History
353 stars in the last 90 days

Explore Similar Projects

Starred by Chip Huyen Chip Huyen(Author of AI Engineering, Designing Machine Learning Systems), Travis Fischer Travis Fischer(Founder of Agentic), and
1 more.

fastmcp by punkpeye

3.7%
2k
TypeScript framework for building MCP servers handling client sessions
created 7 months ago
updated 2 days ago
Feedback? Help us improve.