ruby_llm-mcp  by patvice

Ruby client for Model Context Protocol (MCP) enabling structured LLM workflows

Created 1 year ago
254 stars

Top 99.1% on SourcePulse

GitHubView on GitHub
1 Expert Loves This Project
Project Summary

This library provides a full-featured Ruby client for the Model Context Protocol (MCP), enabling developers to build structured, composable Large Language Model (LLM) workflows directly within Ruby applications using the RubyLLM framework. It simplifies the integration of MCP-compliant tools, resources, and prompts, offering a Ruby-first API for enhanced LLM interaction and workflow automation.

How It Works

This library acts as a bridge, translating MCP specifications into RubyLLM's conversational interface. It supports multiple transport mechanisms—stdio, streamable HTTP, and sse—allowing flexible communication with MCP servers. Core features include seamless integration of MCP tools, resources, and prompts into RubyLLM chats, robust OAuth 2.1 authentication with PKCE and automatic token refresh, and built-in handlers for real-time progress notifications and logging, facilitating interactive and dynamic LLM applications.

Quick Start & Requirements

Installation involves adding gem "ruby_llm-mcp" to your Gemfile and running bundle install. For Rails applications, a generator rails generate ruby_llm:mcp:install is provided. The filesystem tool example requires bunx. An OPENAI_API_KEY is necessary for RubyLLM configuration. OAuth flows may require an MCP_SERVER_URL. Documentation is available at rubyllm-mcp.com.

Highlighted Details

  • Full compliance with MCP spec 2025-06-18 (stable) and draft spec 2026-01-26.
  • Supports stdio, streamable, and sse transport types for MCP communication.
  • Integrated OAuth 2.1 authentication, including PKCE, dynamic registration, discovery, and automatic token refresh.
  • Provides handlers for real-time progress tracking and logging during LLM interactions.
  • Enables direct use of MCP tools, resources, and prompts within RubyLLM chat workflows.
  • Offers specific OAuth setup paths for Rails (per-user) and browser-based CLI flows.

Maintenance & Community

Contributions via issues and pull requests are welcomed at the project's GitHub repository (patvice/ruby_llm-mcp).

Licensing & Compatibility

Released under the permissive MIT License. This license allows for commercial use and integration into closed-source applications without copyleft restrictions.

Limitations & Caveats

The provided documentation does not explicitly detail known limitations, alpha/beta status, or specific unsupported platforms. Users should consult the issue tracker for potential caveats.

Health Check
Last Commit

4 months ago

Responsiveness

Inactive

Pull Requests (30d)
4
Issues (30d)
1
Star History
6 stars in the last 30 days

Explore Similar Projects

Feedback? Help us improve.