Logo van Ruby Llm MCP

Ruby Llm MCP

Community
patvice

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

Uitgeverpatvice
Repositoryruby_llm-mcp
TaalRuby
Forks
39
Sterren
265
Beschikbare tools
0
Transporttypestdio
LicentieMIT
Links
  • Koppel tools aan AI-workflows

    Ruby Llm MCP biedt MCP-functionaliteit die compatibele AI-clients en agenten kunnen gebruiken.

  • 0 beschikbare tools

    Bekijk hieronder de aanroepbare acties, inclusief namen en beschrijvingen als de server die beschikbaar stelt.

  • Configuratie om direct te kopiëren

    Gebruik de installatievoorbeelden om deze server in je favoriete MCP-client te configureren.

  • Indicatoren van opensource-interesse

    265 sterren en 39 forks in de gekoppelde repository.

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

ruby
# 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.")
ruby
# 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.")
ruby
# 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
ruby
# 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
ruby
# 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:

ruby
gem "ruby_llm-mcp"

Then run:

bash
bundle install

If you want the official SDK adapter, also add:

ruby
gem "mcp", "~> 0.7"

Rails

bash
rails generate ruby_llm:mcp:install

For OAuth-based user connections:

bash
rails generate ruby_llm:mcp:oauth:install User

OAuth quick example:

ruby
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:

ruby
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.

Gebruik Ruby Llm MCP MCP met meerdere AI-modellen

TypingMind koppelt MCP-tools aan de werkruimte. Zodra Ruby Llm MCP is verbonden, kun je deze dus met verschillende AI-modellen in TypingMind gebruiken, zonder de verbinding voor elk model apart in te stellen. Deze MCP-integratie draait lokaal via de TypingMind MCP-connector op je apparaat.

Installatiehandleiding voor de lokale connector

Gebruik dit als de MCP-server toegang nodig heeft tot lokale bestanden, apps of privébronnen op je computer.

1

Open de MCP-instellingen

Ga in TypingMind naar Instellingen, Geavanceerde instellingen en vervolgens Model Context Protocol. Kies daar Connector instellen.

  1. Open TypingMind in je browser.
  2. Klik op het pictogram Instellingen.
  3. Ga naar Geavanceerde instellingen.
  4. Open het gedeelte Model Context Protocol.
  5. Klik op Connector instellen en kies Dit apparaat.
Instelscherm voor de TypingMind MCP-connector met Dit apparaat geselecteerd
2

Voer de connectoropdracht uit

Kies Dit apparaat, kopieer de opdracht uit TypingMind en voer deze uit in Terminal. Laat het proces draaien zolang je MCP gebruikt.

  1. Kopieer de installatieopdracht die TypingMind toont.
  2. Open Terminal op macOS of Windows Terminal op Windows.
  3. Plak de opdracht en voer deze uit.
  4. Keur de pakketinstallatie goed als Terminal vraagt of je wilt doorgaan.
  5. Laat het proces in het Terminal-venster draaien zolang je MCP-tools gebruikt.
3

Voeg Ruby Llm MCP toe als server

Klik op Servers bewerken zodra de connectorstatus Gereed is en plak de MCP-serverconfiguratie.

  1. Wacht tot de connectorstatus Gereed aangeeft.
  2. Klik op Servers bewerken.
  3. Plak de MCP-serverconfiguratie van Ruby Llm MCP.
  4. Sla de serverlijst op.
  5. Vernieuw om te controleren of de connector nog steeds klaar is voor gebruik.
MCP-instellingen van TypingMind met een actieve server en de knop Servers bewerken
{
  "mcpServers": {
    "ruby-llm-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

Gebruik de verbinding met verschillende modellen

Sla de serverlijst op, open Plug-ins en schakel de MCP-tools van Ruby Llm MCP in. Selecteer vervolgens een ondersteund AI-model in TypingMind en gebruik de tools in de chat of wijs ze toe aan een AI-agent.

  1. Open de pagina Plug-ins in TypingMind.
  2. Schakel de MCP-tools van Ruby Llm MCP in.
  3. Start een chat en kies het AI-model dat je wilt gebruiken.
  4. Gebruik de MCP-tools in een chat of wijs ze toe aan een AI-agent.
  5. Schakel wanneer nodig over naar een ander AI-model zonder opnieuw verbinding te maken met MCP.
TypingMind-chat met ingeschakelde MCP-tools en een geselecteerd AI-model
Kun je Ruby Llm MCP gebruiken om me hiermee te helpen?
Ruby Llm MCP
Zeker. Ik heb het gelezen.
Dit vond ik met Ruby Llm MCP.

Veelgestelde vragen

Waarvoor wordt de MCP-server Ruby Llm MCP gebruikt?

Ruby Llm MCP is een MCP-server waarmee compatibele AI-clients verbinding kunnen maken met externe tools en context. In TypingMind hoef je deze MCP-server maar één keer toe te voegen om de tools beschikbaar te maken in je AI-werkruimte.

Kan ik Ruby Llm MCP MCP met meerdere AI-modellen in TypingMind gebruiken?

Ja. TypingMind verbindt MCP-tools op werkruimteniveau. Daardoor kun je Ruby Llm MCP gebruiken met verschillende AI-modellen, zoals Claude, ChatGPT, Gemini of andere modellen die je in TypingMind hebt ingesteld, zonder de MCP-server voor elk model afzonderlijk in te stellen.

Waarom Ruby Llm MCP MCP gebruiken met TypingMind?

TypingMind is een van de beste interfaces voor chats met LLM's, omdat het meerdere AI-modellen, prompts, plug-ins, AI-agenten, API-sleutels en MCP-tools samenbrengt in één werkruimte. Als Ruby Llm MCP verbonden is, kun je de MCP-tools ervan gebruiken met je favoriete modellen en je chatworkflow overzichtelijk houden in TypingMind.

Hoe verbind ik Ruby Llm MCP MCP met TypingMind?

Ruby Llm MCP werkt via de lokale MCP-connector van TypingMind. Dit is de beste optie als de MCP-server toegang nodig heeft tot lokale bestanden, desktopapps, opdrachtregeltools of privébronnen op je computer.

Welke tools biedt Ruby Llm MCP MCP in TypingMind?

Ruby Llm MCP biedt MCP-functies die je kunt inschakelen via de pagina Plug-ins in TypingMind. Je kunt ze gebruiken in chats of toewijzen aan AI-agenten.

Moet ik mijn API-sleutels delen met TypingMind om Ruby Llm MCP MCP te gebruiken?

Nee. TypingMind werkt in de eerste plaats lokaal en laat je de controle houden over je modelaanbieders, API-sleutels, prompts en MCP-configuratie. Als Ruby Llm MCP authenticatie vereist, voeg je bij het maken van de verbinding de vereiste headers, OAuth-instellingen of lokale configuratie voor die MCP-server toe.

Gerelateerde MCP-servers

Toon alles

Maak nu je eigen AI-werkruimte

Schrijf je in voor onze nieuwsbrief en blijf op de hoogte van nieuwe functies en toekomstige weggeefacties 👇