modelcontextprotocol/ruby-sdk

The official Ruby SDK for the Model Context Protocol servers and clients.

What it solves

This SDK provides a standardized way for Ruby developers to build servers and clients that communicate using the Model Context Protocol (MCP). It eliminates the need to implement the JSON-RPC based protocol from scratch, allowing AI hosts and tools to exchange resources, prompts, and tools seamlessly.

How it works

The SDK implements the full surface of the MCP protocol, supporting both server-to-client requests and multi-round-trip requests. It provides a high-level API for defining tools (via MCP::Tool classes) and managing the connection lifecycle. It supports multiple transport layers, including standard input/output (stdio) for local processes and Streamable HTTP (including SSE) for remote servers, with specific integration for Ruby on Rails applications.

Who it’s for

Ruby developers who want to integrate their applications into the MCP ecosystem, either by creating tools that LLM-powered agents can use or by building clients that can connect to existing MCP servers.

Highlights

  • Full Protocol Support: Covers notifications, progress, logging, cancellation, completions, and pagination.
  • Flexible Transports: Supports stdio and Streamable HTTP/SSE, making it compatible with both local and remote deployments.
  • Rails Integration: Includes built-in support for mounting MCP servers within Rails apps.
  • Enterprise Ready: Includes OAuth 2.1 authorization for clients.

関連

  • プロジェクト
  • プロジェクト
  • プロジェクト
  • プロジェクト
  • プロジェクト