ruby-sdk  by modelcontextprotocol

Ruby SDK for Model Context Protocol servers and clients

Created 1 year ago
923 stars

Top 39.5% 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

1 day ago

Responsiveness

1 day

Pull Requests (30d)
34
Issues (30d)
7
Star History
2 stars in the last 30 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

0%
3k
TypeScript framework for building MCP servers handling client sessions
Created 1 year ago
Updated 6 days ago
Starred by Adam Wolff Adam Wolff(Claude Code Core; MTS at Anthropic), Samuel Colvin Samuel Colvin(Founder and Author of Pydantic), and
5 more.

anthropic-sdk-python by anthropics

0%
4k
Python SDK for Anthropic's REST API
Created 3 years ago
Updated 1 day ago
Feedback? Help us improve.