Awesome MCPRuby

modelcontextprotocol/ruby-sdk

⭐ 908 Ruby added to this list on 2025-05-14 repository created 2025-02-27

The project 'modelcontextprotocol/ruby-sdk' is the official Ruby SDK designed for implementing Model Context Protocol (MCP) servers and clients. It supports JSON-RPC 2.0 communication and provides comprehensive features for managing tools, prompts, and resources within the MCP framework. The SDK facilitates multiple transport options including integration with Rails applications and command-line environments, making it versatile for different deployment scenarios. At its core, the MCP::Server class handles JSON-RPC requests and responses, implementing the MCP specification to manage model context requests. Key features include protocol initialization, capability negotiation, tool registration and invocation, prompt registration and execution, and resource registration and retrieval. The SDK supports both stdio and Streamable HTTP transports, including Server-Sent Events (SSE) for real-time notifications. The server supports notifications to clients when lists of tools, prompts, or resources change, enabling real-time updates without the need for polling. These notifications adhere to the JSON-RPC 2.0 specification and are sent via HTTP or stdio transports. The SDK also provides examples for usage in Rails controllers and command-line applications, demonstrating how to handle JSON requests and set up transports. Configuration options include exception reporting and instrumentation callbacks, allowing developers to integrate custom error reporting and monitoring solutions. The server context feature allows passing user-defined contextual information to tools, prompts, and callbacks, enhancing customization and integration capabilities. Overall, this SDK is a robust and flexible tool for developers looking to implement MCP-compliant servers and clients in Ruby, supporting advanced features like real-time notifications, multiple transport protocols, and extensible configuration options.

https://github.com/modelcontextprotocol/ruby-sdk

capability-negotiationcommand-lineexception-reportinginstrumentationinstrumentation-callbackinstrumentation-callbacksjson-rpc-2.0mcpmcp-methodsmcp-servermcp-specificationmcp-toolsmodel-context-protocolnotificationsprompt-executionpromptsprotocol-initializationrails-integrationresource-retrievalresourcesruby-sdkserver-contextserver-sent-eventsssestdio-transportstreamable-httpstreamablehttptool-registrationtoolstransport-options

Also in Ruby

yjacquin/fast-mcp

Fast MCP is a Ruby implementation of the Model Context Protocol that simplifies and secures AI model integration with Ruby applications through tools and resources APIs, multiple transport options, and seamless framework support.

patvice/ruby_llm-mcp

Ruby MCP client gem that plugs MCP tools, resources and prompts into RubyLLM chats over stdio, streamable HTTP and SSE, with OAuth 2.1 support and Rails generators.

nagstler/mcp_on_ruby

A Ruby gem that adds an MCP server to a Rails application at /mcp, with generators for tools and resources, JSON Schema validation, per-call authorization, token authentication and rate limiting.