1. Conduid
  2. AI
  3. Ruby LLM MCP
MCP server · AI

Ruby LLM MCP

Full-featured MCP support for Ruby and RubyLLM—making it easy to build structured, composable LLM workflows in pure Ruby.

80Excellent

Scored 7 hours ago · breakdown

About Ruby LLM MCP

Ruby LLM MCP is an MCP server published by patvice in the AI category: full-featured MCP support for Ruby and RubyLLM—making it easy to build structured, composable LLM workflows in pure Ruby.

The repository has 269 stars and 42 forks, with the last commit 9 days ago. Recent commit activity is the strongest signal that reported issues will get attention.

Install

From source
git clone https://github.com/patvice/ruby_llm-mcp

This server has no ConduID identity, so agent calls to it are not receipted. Pin the version you install and review the source before granting it credentials.

Ask AI

✦

Ask AI about Ruby LLM MCP

Powered by Claude · Grounded in docs

I know everything about Ruby LLM MCP. Ask me about installation, configuration, usage, or troubleshooting.

Security checks

Static checks derived from the repository 7 hours ago. Heuristics on the source, not an audit.

  • ✓README presentThe repository ships documentation.
  • ✓License declaredUsable under a stated license.
  • ✓Tests presentA test suite exists in the repository.
  • ✓Dependencies pinnedA lockfile pins dependency versions.
  • !No dynamic code executionSource scan found eval or shell execution. Review how tool inputs reach it before granting credentials.
  • !Scoped permissionsDoesn't declare a permission scope. Assume it can do anything its process can.

Releases

v1.0.1V1.0.1 · 21 Jul 2026What's Changed Solved another spec race condition with that effects JRuby by @patvice in https://github.com/patvice/ruby_llm-mcp/pull/134 Fail pending Streamable HTTP requests on POST 405 by @jstar0 in…
v1.0.0v1.0.0 🎉 · 23 Feb 2026RubyLLM::MCP v1.0.0 🎉 (from v0.8.0) `v1.0.0` is a major milestone for RubyLLM::MCP. This release moves the project from rapid foundation work to a much more stable, protocol-aligned, production-ready baseline. This includes stability in…
v0.8.0v0.8.0 · 11 Nov 2025RubyLLM::MCP v0.8 - OAuth 2.1 Support!! Version 0.8.0 adds comprehensive OAuth 2.1 support for secure authentication with MCP servers. OAuth 2.1 Authentication This release implements OAuth 2.1 compliance with the security features you'd…
v0.7.1v0.7.1 · 6 Nov 2025What's Changed Fix STDIO transport stream closure errors during graceful shutdown by @parruda in https://github.com/patvice/ruby_llm-mcp/pull/85 Bump version to 0.7.1 by @patvice in https://github.com/patvice/ruby_llm-mcp/pull/86 New…
v0.7.0v0.7.0 · 4 Nov 2025v0.7 - Support for RubyLLM v1.9 Full support for RubyLLM v1.9 Removes the need for support_complex_parameters!. Starting with this release, all future versions of RubyLLM::MCP will include full MCP tool capabilities out of the box. What's…

README

MCP for Ruby and RubyLLM, as easy as possible.

Gem Version Gem Downloads

RubyLLM::MCP is a Ruby client for the Model Context Protocol (MCP), built to work cleanly with RubyLLM. Aiming to be completely spec compliant.

Use MCP tools, resources, and prompts from your RubyLLM chats over stdio, streamable HTTP, or SSE.

Protocol support: Fully supports MCP spec 2025-06-18 (stable), with draft spec 2026-01-26 available.

RubyLLM::MCP Out of the Box

Our goal is to be able to plug MCP into Ruby/RubyLLM apps as easily as possible.

RubyLLM::MCP gives you that:

  • Ruby-first API for using MCP tools, resources, and prompts directly in RubyLLM chat workflows
  • Stable protocol track by default (2025-06-18), with opt-in draft track (2026-01-26)
  • Built-in notification and response handlers for real-time and interactive workflows
  • MCP OAuth 2.1 authentication support (PKCE, dynamic registration, discovery, and automatic token refresh)
  • OAuth setup paths for Rails apps (per-user connections) and browser-based CLI flows
  • Straightforward integration for any Ruby app, background job, or Rails project using RubyLLM

Show me the code

# Basic setup
require "ruby_llm/mcp"

RubyLLM.configure do |config|
  config.openai_api_key = ENV.fetch("OPENAI_API_KEY")
end

client = RubyLLM::MCP.client(
  name: "filesystem",
  transport_type: :stdio,
  config: {
    command: "bunx",
    args: ["@modelcontextprotocol/server-filesystem", Dir.pwd]
  }
)

chat = RubyLLM.chat(model: "gpt-4.1-mini")
chat.with_tools(*client.tools)

puts chat.ask("Find Ruby files modified today and summarize what changed.")
# Resources
resource = client.resource("release_notes")
chat = RubyLLM.chat(model: "gpt-4.1-mini")
chat.with_resource(resource)

puts chat.ask("Summarize release notes for the team in 5 bullet points.")
# Prompts
prompt = client.prompt("code_review")
chat = RubyLLM.chat(model: "gpt-4.1-mini")

response = chat.ask_prompt(
  prompt,
  arguments: {
    language: "ruby",
    focus: "security"
  }
)

puts response
# Handlers (response + notifications)
client.on_progress do |progress|
  puts "Progress: #{progress.progress}% - #{progress.message}"
end

client.on_logging do |logging|
  puts "[#{logging.level}] #{logging.message}"
end

chat = RubyLLM.chat(model: "gpt-4.1-mini")
chat.with_tools(*client.tools)

chat.ask("Run a repository scan and summarize risks.") do |chunk|
  print chunk.content
end
# OAuth setup (Rails and CLI)
# Rails: per-user OAuth client (after running rails generate ruby_llm:mcp:oauth:install User)
client = current_user.mcp_client
chat = RubyLLM.chat(model: "gpt-4.1-mini")
chat.with_tools(*client.tools)
puts chat.ask("What changed in my connected repos this week?")

# CLI: browser-based OAuth flow
cli_client = RubyLLM::MCP.client(
  name: "oauth-server",
  transport_type: :streamable,
  start: false,
  config: {
    url: ENV.fetch("MCP_SERVER_URL"),
    oauth: { scope: "mcp:read mcp:write" }
  }
)

cli_client.oauth(type: :browser).authenticate
cli_client.start
puts RubyLLM.chat(model: "gpt-4.1-mini").with_tools(*cli_client.tools).ask("List my open tasks.")
cli_client.stop

Features

  • Tools: Convert MCP tools into RubyLLM-compatible tools
  • Resources: Work with resources and resource templates in chat context
  • Prompts: Execute server prompts with typed arguments
  • Transports: :stdio, :streamable, and :sse
  • Client capabilities: Sampling, roots, progress tracking, and elicitation
  • Handlers: Built-in notification and response handlers for real-time and interactive workflows
  • MCP Authentication: OAuth 2.1 support with PKCE, dynamic registration, discovery, and automatic token refresh
  • OAuth setup paths: Rails per-user OAuth setup and browser-based OAuth for CLI tools
  • Extensions: Global/per-client extension negotiation, including MCP Apps
  • Multi-client support: Manage multiple MCP servers in one workflow
  • Protocol control: Stable default with explicit draft opt-in
  • Adapters: Native :ruby_llm adapter (full feature set) and optional :mcp_sdk

Installation

Add to your Gemfile:

gem "ruby_llm-mcp"

Then run:

bundle install

If you want the official SDK adapter, also add:

gem "mcp", "~> 0.7"

Rails

rails generate ruby_llm:mcp:install

For OAuth-based user connections:

rails generate ruby_llm:mcp:oauth:install User

OAuth quick example:

client = RubyLLM::MCP.client(
  name: "oauth-server",
  transport_type: :streamable,
  start: false,
  config: {
    url: ENV.fetch("MCP_SERVER_URL"),
    oauth: { scope: "mcp:read mcp:write" }
  }
)

client.oauth(type: :browser).authenticate
client.start

chat = RubyLLM.chat(model: "gpt-4.1-mini")
chat.with_tools(*client.tools)
puts chat.ask("What should I prioritize today?")

client.stop

Then use explicit connection blocks in jobs/controllers/services:

RubyLLM::MCP.establish_connection do |clients|
  chat = RubyLLM.chat(model: "gpt-4.1-mini")
  chat.with_tools(*clients.tools)
  chat.ask("Analyze this pull request and list risks.")
end

Documentation

Contributing

Issues and pull requests are welcome at patvice/ruby_llm-mcp.

License

Released under the MIT License.

README fetched from the repository 7 hours ago. The original is authoritative.

Questions

About Ruby LLM MCP

How do I install Ruby LLM MCP?

No package has been published for this server, so install it from source: clone the repository and follow its README.

Is Ruby LLM MCP safe to use with an AI agent?

Its trust score is 80 out of 100 (excellent). It passes 4 of the 6 static security checks run so far; the failures are listed above. It has no ConduID identity yet, so agent calls to it are not receipted.

Is Ruby LLM MCP still maintained?

Yes — the latest release is v1.0.1 (21 Jul 2026), and the last commit was 9 days ago. The repository has 269 stars and 10 open issues.