MCP Ruby SDK
The official Ruby SDK for building and connecting to Model Context Protocol servers and clients, with stdio and Streamable HTTP transports and a Rails integration.
MCP Ruby SDK is the official Ruby implementation for building Model Context Protocol servers, which expose tools, prompts and resources to any MCP host, and clients, which connect to any MCP server with automatic lifecycle negotiation and OAuth 2.1 authorization. It speaks both standard transports, stdio and Streamable HTTP including Server-Sent Events, with a Rails integration for mounting a server inside a Rails application, and covers the full protocol surface: server-to-client requests, multi round-trip requests, notifications, progress, logging, cancellation, completions and pagination.
It installs as the mcp gem through Bundler or gem install, and a minimal server and client example in the documentation show both sides of the protocol: a server that defines and serves one tool over stdio, and a client that spawns that server as a subprocess and lists and calls its tools. Runnable examples, including a complete Rails application, are included in the repository.