{"id":28348552,"url":"https://github.com/patvice/ruby_llm-mcp","last_synced_at":"2026-03-16T05:32:57.125Z","repository":{"id":295305259,"uuid":"988476305","full_name":"patvice/ruby_llm-mcp","owner":"patvice","description":"Full-featured MCP support for Ruby and RubyLLM—making it easy to build structured, composable LLM workflows in pure Ruby.","archived":false,"fork":false,"pushed_at":"2026-03-05T16:31:54.000Z","size":14033,"stargazers_count":228,"open_issues_count":4,"forks_count":22,"subscribers_count":4,"default_branch":"main","last_synced_at":"2026-03-05T19:31:39.375Z","etag":null,"topics":["ai","llms","mcp","mcp-clients","rails","ruby","ruby-llm"],"latest_commit_sha":null,"homepage":"https://www.rubyllm-mcp.com/","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/patvice.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-05-22T15:47:41.000Z","updated_at":"2026-03-05T16:38:33.000Z","dependencies_parsed_at":null,"dependency_job_id":"6b304086-5e2f-4332-9a52-5282aaad2585","html_url":"https://github.com/patvice/ruby_llm-mcp","commit_stats":null,"previous_names":["patvice/ruby_llm-mcp"],"tags_count":18,"template":false,"template_full_name":null,"purl":"pkg:github/patvice/ruby_llm-mcp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patvice%2Fruby_llm-mcp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patvice%2Fruby_llm-mcp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patvice%2Fruby_llm-mcp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patvice%2Fruby_llm-mcp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/patvice","download_url":"https://codeload.github.com/patvice/ruby_llm-mcp/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patvice%2Fruby_llm-mcp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30567841,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-16T04:42:47.996Z","status":"ssl_error","status_checked_at":"2026-03-16T04:42:44.668Z","response_time":96,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","llms","mcp","mcp-clients","rails","ruby","ruby-llm"],"created_at":"2025-05-27T18:40:45.294Z","updated_at":"2026-03-16T05:32:57.119Z","avatar_url":"https://github.com/patvice.png","language":"Ruby","funding_links":[],"categories":["📚 Projects (1974 total)","Ruby"],"sub_categories":["MCP Servers"],"readme":"\u003cdiv align=\"center\"\u003e\n\n\u003cimg src=\"docs/assets/images/rubyllm-mcp-logo-text.svg#gh-light-mode-only\" alt=\"RubyLLM::MCP\" height=\"120\" width=\"250\"\u003e\n\u003cimg src=\"docs/assets/images/rubyllm-mcp-logo-text-white.svg#gh-dark-mode-only\" alt=\"RubyLLM::MCP\" height=\"120\" width=\"250\"\u003e\n\n\u003cstrong\u003eMCP for Ruby and RubyLLM, as easy as possible.\u003c/strong\u003e\n\n[![Gem Version](https://badge.fury.io/rb/ruby_llm-mcp.svg)](https://badge.fury.io/rb/ruby_llm-mcp)\n[![Gem Downloads](https://img.shields.io/gem/dt/ruby_llm-mcp)](https://rubygems.org/gems/ruby_llm-mcp)\n\n\u003c/div\u003e\n\nRubyLLM::MCP is a Ruby client for the [Model Context Protocol (MCP)](https://modelcontextprotocol.io/), built to work cleanly with [RubyLLM](https://github.com/crmne/ruby_llm). Aiming to be completely spec compliant.\n\nUse MCP tools, resources, and prompts from your RubyLLM chats over `stdio`, streamable HTTP, or SSE.\n\n**Protocol support:** Fully supports MCP spec `2025-06-18` (stable), with draft spec `2026-01-26` available.\n\n## RubyLLM::MCP Out of the Box\n\nOur goal is to be able to plug MCP into Ruby/RubyLLM apps as easily as possible.\n\nRubyLLM::MCP gives you that:\n\n- Ruby-first API for using MCP tools, resources, and prompts directly in RubyLLM chat workflows\n- Stable protocol track by default (`2025-06-18`), with opt-in draft track (`2026-01-26`)\n- Built-in notification and response handlers for real-time and interactive workflows\n- MCP OAuth 2.1 authentication support (PKCE, dynamic registration, discovery, and automatic token refresh)\n- OAuth setup paths for Rails apps (per-user connections) and browser-based CLI flows\n- Straightforward integration for any Ruby app, background job, or Rails project using RubyLLM\n\n## Show me the code\n\n```ruby\n# Basic setup\nrequire \"ruby_llm/mcp\"\n\nRubyLLM.configure do |config|\n  config.openai_api_key = ENV.fetch(\"OPENAI_API_KEY\")\nend\n\nclient = RubyLLM::MCP.client(\n  name: \"filesystem\",\n  transport_type: :stdio,\n  config: {\n    command: \"bunx\",\n    args: [\"@modelcontextprotocol/server-filesystem\", Dir.pwd]\n  }\n)\n\nchat = RubyLLM.chat(model: \"gpt-4.1-mini\")\nchat.with_tools(*client.tools)\n\nputs chat.ask(\"Find Ruby files modified today and summarize what changed.\")\n```\n\n```ruby\n# Resources\nresource = client.resource(\"release_notes\")\nchat = RubyLLM.chat(model: \"gpt-4.1-mini\")\nchat.with_resource(resource)\n\nputs chat.ask(\"Summarize release notes for the team in 5 bullet points.\")\n```\n\n```ruby\n# Prompts\nprompt = client.prompt(\"code_review\")\nchat = RubyLLM.chat(model: \"gpt-4.1-mini\")\n\nresponse = chat.ask_prompt(\n  prompt,\n  arguments: {\n    language: \"ruby\",\n    focus: \"security\"\n  }\n)\n\nputs response\n```\n\n```ruby\n# Handlers (response + notifications)\nclient.on_progress do |progress|\n  puts \"Progress: #{progress.progress}% - #{progress.message}\"\nend\n\nclient.on_logging do |logging|\n  puts \"[#{logging.level}] #{logging.message}\"\nend\n\nchat = RubyLLM.chat(model: \"gpt-4.1-mini\")\nchat.with_tools(*client.tools)\n\nchat.ask(\"Run a repository scan and summarize risks.\") do |chunk|\n  print chunk.content\nend\n```\n\n```ruby\n# OAuth setup (Rails and CLI)\n# Rails: per-user OAuth client (after running rails generate ruby_llm:mcp:oauth:install User)\nclient = current_user.mcp_client\nchat = RubyLLM.chat(model: \"gpt-4.1-mini\")\nchat.with_tools(*client.tools)\nputs chat.ask(\"What changed in my connected repos this week?\")\n\n# CLI: browser-based OAuth flow\ncli_client = RubyLLM::MCP.client(\n  name: \"oauth-server\",\n  transport_type: :streamable,\n  start: false,\n  config: {\n    url: ENV.fetch(\"MCP_SERVER_URL\"),\n    oauth: { scope: \"mcp:read mcp:write\" }\n  }\n)\n\ncli_client.oauth(type: :browser).authenticate\ncli_client.start\nputs RubyLLM.chat(model: \"gpt-4.1-mini\").with_tools(*cli_client.tools).ask(\"List my open tasks.\")\ncli_client.stop\n```\n\n## Features\n\n- **Tools:** Convert MCP tools into RubyLLM-compatible tools\n- **Resources:** Work with resources and resource templates in chat context\n- **Prompts:** Execute server prompts with typed arguments\n- **Transports:** `:stdio`, `:streamable`, and `:sse`\n- **Client capabilities:** Sampling, roots, progress tracking, and elicitation\n- **Handlers:** Built-in notification and response handlers for real-time and interactive workflows\n- **MCP Authentication:** OAuth 2.1 support with PKCE, dynamic registration, discovery, and automatic token refresh\n- **OAuth setup paths:** Rails per-user OAuth setup and browser-based OAuth for CLI tools\n- **Extensions:** Global/per-client extension negotiation, including MCP Apps\n- **Multi-client support:** Manage multiple MCP servers in one workflow\n- **Protocol control:** Stable default with explicit draft opt-in\n- **Adapters:** Native `:ruby_llm` adapter (full feature set) and optional `:mcp_sdk`\n\n## Installation\n\nAdd to your Gemfile:\n\n```ruby\ngem \"ruby_llm-mcp\"\n```\n\nThen run:\n\n```bash\nbundle install\n```\n\nIf you want the official SDK adapter, also add:\n\n```ruby\ngem \"mcp\", \"~\u003e 0.7\"\n```\n\n## Rails\n\n```bash\nrails generate ruby_llm:mcp:install\n```\n\nFor OAuth-based user connections:\n\n```bash\nrails generate ruby_llm:mcp:oauth:install User\n```\n\nOAuth quick example:\n\n```ruby\nclient = RubyLLM::MCP.client(\n  name: \"oauth-server\",\n  transport_type: :streamable,\n  start: false,\n  config: {\n    url: ENV.fetch(\"MCP_SERVER_URL\"),\n    oauth: { scope: \"mcp:read mcp:write\" }\n  }\n)\n\nclient.oauth(type: :browser).authenticate\nclient.start\n\nchat = RubyLLM.chat(model: \"gpt-4.1-mini\")\nchat.with_tools(*client.tools)\nputs chat.ask(\"What should I prioritize today?\")\n\nclient.stop\n```\n\nThen use explicit connection blocks in jobs/controllers/services:\n\n```ruby\nRubyLLM::MCP.establish_connection do |clients|\n  chat = RubyLLM.chat(model: \"gpt-4.1-mini\")\n  chat.with_tools(*clients.tools)\n  chat.ask(\"Analyze this pull request and list risks.\")\nend\n```\n\n## Documentation\n\n- [rubyllm-mcp.com](https://rubyllm-mcp.com/)\n- [Getting Started](https://rubyllm-mcp.com/getting-started/getting-started.html)\n- [Rails Integration](https://rubyllm-mcp.com/guides/rails-integration.html)\n- [Adapters and transports](https://rubyllm-mcp.com/guides/adapters.html)\n\n## Contributing\n\nIssues and pull requests are welcome at [patvice/ruby_llm-mcp](https://github.com/patvice/ruby_llm-mcp).\n\n## License\n\nReleased under the MIT License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpatvice%2Fruby_llm-mcp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpatvice%2Fruby_llm-mcp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpatvice%2Fruby_llm-mcp/lists"}