<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Ryo Hayakawa</title>
    <description>The latest articles on DEV Community by Ryo Hayakawa (@rira100000000).</description>
    <link>https://dev.to/rira100000000</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3819622%2F666ab036-840e-4283-8f47-d0160aba557f.jpg</url>
      <title>DEV Community: Ryo Hayakawa</title>
      <link>https://dev.to/rira100000000</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/rira100000000"/>
    <language>en</language>
    <item>
      <title>I Built an MCP Server That Lets AI Agents Debug Running Ruby Processes</title>
      <dc:creator>Ryo Hayakawa</dc:creator>
      <pubDate>Thu, 12 Mar 2026 06:51:51 +0000</pubDate>
      <link>https://dev.to/rira100000000/i-built-an-mcp-server-that-lets-ai-agents-debug-running-ruby-processes-gbg</link>
      <guid>https://dev.to/rira100000000/i-built-an-mcp-server-that-lets-ai-agents-debug-running-ruby-processes-gbg</guid>
      <description>&lt;p&gt;girb-mcp is an MCP server that gives LLM agents access to running Ruby processes.&lt;/p&gt;

&lt;p&gt;

&lt;/p&gt;
&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://assets.dev.to/assets/github-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/rira100000000" rel="noopener noreferrer"&gt;
        rira100000000
      &lt;/a&gt; / &lt;a href="https://github.com/rira100000000/girb-mcp" rel="noopener noreferrer"&gt;
        girb-mcp
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;girb-mcp&lt;/h1&gt;
&lt;/div&gt;
&lt;p&gt;&lt;a href="https://github.com/rira100000000/girb-mcp/README.ja.md" rel="noopener noreferrer"&gt;日本語版 (Japanese)&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;MCP (Model Context Protocol) server that gives LLM agents access to the runtime context of executing Ruby processes.&lt;/p&gt;
&lt;p&gt;LLM agents can connect to a paused Ruby process, inspect variables, evaluate code, set breakpoints, and control execution — all through MCP tool calls.&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;What it does&lt;/h2&gt;
&lt;/div&gt;
&lt;p&gt;Existing Ruby/Rails MCP servers only provide static analysis or application-level APIs. girb-mcp goes further: it connects to &lt;strong&gt;running Ruby processes&lt;/strong&gt; via the debug gem and exposes their runtime state to LLM agents.&lt;/p&gt;
&lt;div class="snippet-clipboard-content notranslate position-relative overflow-auto"&gt;&lt;pre class="notranslate"&gt;&lt;code&gt;Agent → connect(host: "localhost", port: 12345)
Agent → get_context()
  → local variables, instance variables, call stack
Agent → evaluate_code(code: "user.valid?")
  → false
Agent → evaluate_code(code: "user.errors.full_messages")
  → ["Email can't be blank"]
Agent → continue_execution()
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Installation&lt;/h2&gt;
&lt;/div&gt;
&lt;div class="highlight highlight-source-ruby notranslate position-relative overflow-auto js-code-highlight"&gt;
&lt;pre&gt;&lt;span class="pl-en"&gt;gem&lt;/span&gt; &lt;span class="pl-s"&gt;"girb-mcp"&lt;/span&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;Or install directly:&lt;/p&gt;
&lt;div class="snippet-clipboard-content notranslate position-relative overflow-auto"&gt;&lt;pre class="notranslate"&gt;&lt;code&gt;gem install girb-mcp
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Requires Ruby &amp;gt;= 3.2.0.&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Quick Start&lt;/h2&gt;

&lt;/div&gt;
&lt;div class="markdown-heading"&gt;
&lt;h3 class="heading-element"&gt;1. Start a Ruby process with the debugger&lt;/h3&gt;

&lt;/div&gt;
&lt;div class="highlight highlight-source-shell notranslate position-relative overflow-auto js-code-highlight"&gt;
&lt;pre&gt;&lt;span class="pl-c"&gt;&lt;span class="pl-c"&gt;#&lt;/span&gt; Script&lt;/span&gt;
rdbg --open --port=12345 my_script.rb
&lt;span class="pl-c"&gt;&lt;span class="pl-c"&gt;#&lt;/span&gt; Or with environment variables&lt;/span&gt;
RUBY_DEBUG_OPEN=true RUBY_DEBUG_PORT=12345&lt;/pre&gt;…
&lt;/div&gt;
&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/rira100000000/girb-mcp" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;




&lt;p&gt;It works with any client that supports MCP (Model Context Protocol). Tested with Claude Code and Gemini CLI.&lt;/p&gt;

&lt;p&gt;For example, you can simply tell the agent "investigate this bug," and it will actually send requests, inspect runtime state, and identify the root cause:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;You:   The users list page is returning a 500 error.
       Connect to the debug session and find out why.

Agent: I set a breakpoint in the controller and sent a request.
       After inspecting variables at the stop point, I found a record
       with a nil name in @users (User ID: 42).
       The view calls user.name.uppercase, which raises a
       NoMethodError at that point.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;The key here is the ability to see &lt;strong&gt;what's actually happening at runtime&lt;/strong&gt; — something you can't get just by reading code.&lt;/p&gt;

&lt;p&gt;Check out this video to see it in action:&lt;/p&gt;

&lt;p&gt;

  &lt;iframe src="https://www.youtube.com/embed/u3udec_pd1I"&gt;
  &lt;/iframe&gt;


&lt;/p&gt;
&lt;h2&gt;
  
  
  How girb-mcp Differs from girb
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://rira100000000.hatenablog.com/entry/2026/02/08/111829" rel="noopener noreferrer"&gt;girb, which I released recently&lt;/a&gt;, is a tool for humans to interactively call AI from within IRB or the Rails console.&lt;br&gt;


&lt;/p&gt;
&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://assets.dev.to/assets/github-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/rira100000000" rel="noopener noreferrer"&gt;
        rira100000000
      &lt;/a&gt; / &lt;a href="https://github.com/rira100000000/girb" rel="noopener noreferrer"&gt;
        girb
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;girb (Generative IRB)&lt;/h1&gt;
&lt;/div&gt;

&lt;p&gt;An AI assistant for Ruby development. Works with IRB, Rails console, and the debug gem.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/rira100000000/girb/README_ja.md" rel="noopener noreferrer"&gt;日本語版 README&lt;/a&gt;&lt;/p&gt;

&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Features&lt;/h2&gt;
&lt;/div&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Context Awareness&lt;/strong&gt;: Understands local variables, instance variables, and runtime state&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Tool Execution&lt;/strong&gt;: AI autonomously executes code, inspects objects, and reads files&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Autonomous Investigation&lt;/strong&gt;: AI loops through investigate-execute-analyze cycles&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Multi-environment Support&lt;/strong&gt;: Works with IRB, Rails console, and debug gem (rdbg)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Provider Agnostic&lt;/strong&gt;: Use any LLM (OpenAI, Anthropic, Gemini, Ollama, etc.)&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Quick Start&lt;/h2&gt;
&lt;/div&gt;

&lt;div class="highlight highlight-source-shell notranslate position-relative overflow-auto js-code-highlight"&gt;
&lt;pre&gt;&lt;span class="pl-c"&gt;&lt;span class="pl-c"&gt;#&lt;/span&gt; 1. Install&lt;/span&gt;
gem install girb girb-ruby_llm

&lt;span class="pl-c"&gt;&lt;span class="pl-c"&gt;#&lt;/span&gt; 2. Set your API key&lt;/span&gt;
&lt;span class="pl-k"&gt;export&lt;/span&gt; GEMINI_API_KEY=&lt;span class="pl-s"&gt;&lt;span class="pl-pds"&gt;"&lt;/span&gt;your-api-key&lt;span class="pl-pds"&gt;"&lt;/span&gt;&lt;/span&gt;  &lt;span class="pl-c"&gt;&lt;span class="pl-c"&gt;#&lt;/span&gt; or OPENAI_API_KEY, ANTHROPIC_API_KEY&lt;/span&gt;

&lt;span class="pl-c"&gt;&lt;span class="pl-c"&gt;#&lt;/span&gt; 3. Create ~/.girbrc&lt;/span&gt;
&lt;span class="pl-s"&gt;&lt;span class="pl-pds"&gt;`&lt;/span&gt;&lt;span class="pl-pds"&gt;`&lt;/span&gt;&lt;span class="pl-pds"&gt;`&lt;/span&gt;ruby&lt;/span&gt;
&lt;span class="pl-s"&gt;require &lt;span class="pl-s"&gt;&lt;span class="pl-pds"&gt;'&lt;/span&gt;girb-ruby_llm&lt;span class="pl-pds"&gt;'&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class="pl-s"&gt;Girb.configure &lt;span class="pl-k"&gt;do&lt;/span&gt; &lt;span class="pl-k"&gt;|&lt;/span&gt;c&lt;span class="pl-k"&gt;|&lt;/span&gt;&lt;/span&gt;
&lt;span class="pl-s"&gt;  c.provider = Girb::Providers::RubyLlm.new(model: &lt;span class="pl-s"&gt;&lt;span class="pl-pds"&gt;'&lt;/span&gt;gemini-2.5-flash&lt;span class="pl-pds"&gt;'&lt;/span&gt;&lt;/span&gt;)&lt;/span&gt;
&lt;span class="pl-s"&gt;end&lt;/span&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;4. Run&lt;/h1&gt;

&lt;/div&gt;

&lt;p&gt;girb&lt;/p&gt;

&lt;div class="snippet-clipboard-content notranslate position-relative overflow-auto"&gt;
&lt;pre class="notranslate"&gt;&lt;code&gt;
Then type a question and press **Ctrl+Space**, or use `qq &amp;lt;question&amp;gt;`
## Table of Contents

1. [Configuration](#1-configuration) - Common setup for all environments&lt;/code&gt;&lt;/pre&gt;…&lt;/div&gt;
&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/rira100000000/girb" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;





&lt;p&gt;girb-mcp takes the same approach — "accessing the context of a running Ruby process" — and makes it available to LLM agents.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;girb&lt;/th&gt;
&lt;th&gt;girb-mcp&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Who uses it&lt;/td&gt;
&lt;td&gt;Humans (interactive in IRB)&lt;/td&gt;
&lt;td&gt;LLM agents (via MCP)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Interface&lt;/td&gt;
&lt;td&gt;Commands in the REPL&lt;/td&gt;
&lt;td&gt;MCP tool calls&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;How to run&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;girb&lt;/code&gt; or &lt;code&gt;binding.girb&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;Add to MCP client config&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;If girb is a tool for "humans debugging with AI assistance," then girb-mcp is a tool for "AI debugging autonomously."&lt;/p&gt;

&lt;h2&gt;
  
  
  How It Differs from Existing MCP Servers
&lt;/h2&gt;

&lt;p&gt;There are already several MCP servers for Ruby/Rails, but they mainly focus on static analysis and application-level APIs (DB queries, route inspection, etc.).&lt;/p&gt;

&lt;p&gt;girb-mcp connects to a &lt;strong&gt;running Ruby process&lt;/strong&gt; via the debug gem and exposes its runtime state to the agent.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Agent → connect(host: "localhost", port: 12345)
Agent → get_context()
  → local variables, instance variables, call stack
Agent → evaluate_code(code: "user.valid?")
  → false
Agent → evaluate_code(code: "user.errors.full_messages")
  → ["Email can't be blank"]
Agent → continue_execution()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The decisive difference from static analysis is the ability to actually evaluate and return things like "what value does this variable hold right now?" or "what's the result of &lt;code&gt;user.valid?&lt;/code&gt;?"&lt;/p&gt;

&lt;p&gt;In a dynamic language like Ruby, there are many bugs you can't figure out just by reading code, so I believe this approach is particularly effective.&lt;/p&gt;

&lt;h2&gt;
  
  
  Architecture
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhnargsetcy9m2mjegg6q.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhnargsetcy9m2mjegg6q.png" alt=" "&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The debug gem (&lt;code&gt;rdbg --open&lt;/code&gt;) exposes a socket on the target Ruby process&lt;/li&gt;
&lt;li&gt;girb-mcp connects to that socket using the debug gem's protocol&lt;/li&gt;
&lt;li&gt;Tool calls from the MCP client are translated into debugger commands, and the results are returned&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;MCP is an open standard developed by Anthropic — a protocol for connecting LLMs to external tools. girb-mcp uses the mcp gem to comply with this specification, so it works with any MCP-compatible client.&lt;/p&gt;

&lt;h2&gt;
  
  
  Features
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Investigation Tools
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Tool&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;evaluate_code&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Execute Ruby code in the stopped binding&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;inspect_object&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Get an object's class, value, and instance variables&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;get_context&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Get local variables, instance variables, call stack, and breakpoints all at once&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;get_source&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Get the source code of a method or class&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  Execution Control
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Tool&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;set_breakpoint&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Set breakpoints by line, method, or exception class&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;continue_execution&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Resume execution until the next breakpoint or termination&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;step&lt;/code&gt; / &lt;code&gt;next&lt;/code&gt; / &lt;code&gt;finish&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;Step in / step over / run until method returns&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  Rails Support
&lt;/h3&gt;

&lt;p&gt;Rails-specific tools are automatically added when a Rails process is detected.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Tool&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;rails_info&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Show app name, Rails version, environment, and DB info&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;rails_routes&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Show routes with filtering&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;rails_model&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Show a model's columns, associations, validations, and enums&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;trigger_request&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Send an HTTP request to the Rails app being debugged&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;code&gt;trigger_request&lt;/code&gt; automatically disables CSRF protection temporarily for POST and other requests, so you can send requests without worrying about tokens.&lt;/p&gt;

&lt;h2&gt;
  
  
  Beyond Debugging: The Next Step in AI Coding
&lt;/h2&gt;

&lt;p&gt;When you ask AI to implement something, it writes tests too. And the tests pass. But are those tests actually correct?&lt;/p&gt;

&lt;p&gt;Tests written by AI only verify "the spec as the AI understood it." They don't necessarily verify the behavior the user intended. The tests pass, but when you actually run the app, it doesn't work the way you expected. I think this is a common experience in AI coding.&lt;/p&gt;

&lt;p&gt;With girb-mcp, you can go one step further beyond tests:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;AI writes the implementation&lt;/li&gt;
&lt;li&gt;AI writes and passes the tests&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Use girb-mcp to actually run the app and verify it behaves as intended&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;For example, say you asked AI to implement "only admins can delete articles." After the tests pass, you can actually send a DELETE request and confirm that a regular user gets a 403, and an admin successfully deletes the article — verified through actual behavior.&lt;/p&gt;

&lt;p&gt;Where before the story ended with "tests pass, now a human needs to manually verify," you can now delegate verification to the AI as well. Humans just need to look at the final working result and make a judgment.&lt;/p&gt;

&lt;h2&gt;
  
  
  Installation and Setup
&lt;/h2&gt;

&lt;p&gt;Install the gem:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;gem &lt;span class="nb"&gt;install &lt;/span&gt;girb-mcp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Add girb-mcp to your MCP client's configuration.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;For Claude Code&lt;/strong&gt; (&lt;code&gt;~/.claude/settings.json&lt;/code&gt;):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"mcpServers"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"girb-mcp"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"command"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"girb-mcp"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"args"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;For Gemini CLI&lt;/strong&gt; (&lt;code&gt;~/.gemini/settings.json&lt;/code&gt;):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"mcpServers"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"girb-mcp"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"command"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"girb-mcp"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"args"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Any MCP client that supports STDIO transport can use a similar configuration.&lt;br&gt;
If using Bundler, change &lt;code&gt;command&lt;/code&gt; to &lt;code&gt;bundle&lt;/code&gt; and &lt;code&gt;args&lt;/code&gt; to &lt;code&gt;["exec", "girb-mcp"]&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Requires Ruby &amp;gt;= 3.2.0.&lt;/p&gt;
&lt;h2&gt;
  
  
  Try It Out
&lt;/h2&gt;
&lt;h3&gt;
  
  
  Debugging a Ruby Script
&lt;/h3&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;rdbg &lt;span class="nt"&gt;--open&lt;/span&gt; &lt;span class="nt"&gt;--port&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;12345 my_script.rb
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Then just ask the agent:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Connect to the debug session and show me the current state."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;There's also a &lt;code&gt;run_script&lt;/code&gt; tool, so you can let the agent handle launching the Ruby script itself.&lt;/p&gt;
&lt;h3&gt;
  
  
  Debugging a Rails App
&lt;/h3&gt;

&lt;p&gt;girb-mcp comes with a command to start a Rails server in debug mode:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;girb-rails    &lt;span class="c"&gt;# Equivalent to RUBY_DEBUG_OPEN=true bin/rails server&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Tell the agent:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Set a breakpoint on line 15 of app/controllers/users_controller.rb and send a GET request to /users/1."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The agent will automatically handle the entire flow: setting the breakpoint → sending the request → inspecting variables at the stop point.&lt;/p&gt;

&lt;h3&gt;
  
  
  Works with Processes Inside Docker Too
&lt;/h3&gt;

&lt;p&gt;You can connect to Ruby processes inside Docker via TCP or Unix socket volume mounts. When connecting via TCP, you can browse and read files inside the container even without having the source code locally.&lt;/p&gt;

&lt;h2&gt;
  
  
  Security Notes
&lt;/h2&gt;

&lt;p&gt;A few things to keep in mind:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;evaluate_code&lt;/code&gt; can execute arbitrary Ruby code.&lt;/strong&gt; However, dangerous operations like file manipulation and system commands are restricted by the LLM agent's policies. girb-mcp is simply a "window to the debugger" and is designed to be used in combination with the agent's guardrails.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The debug gem has no authentication.&lt;/strong&gt; When exposing a debug port via TCP, bind to &lt;code&gt;127.0.0.1&lt;/code&gt; or otherwise restrict access.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Do not use in production.&lt;/strong&gt; This is a tool for development and debugging purposes only.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The girb Family
&lt;/h2&gt;

&lt;p&gt;girb-mcp is part of the &lt;a href="https://github.com/rira100000000/girb" rel="noopener noreferrer"&gt;girb&lt;/a&gt; family:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;girb&lt;/strong&gt; — AI-powered IRB assistant (interactive, for humans)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;girb-mcp&lt;/strong&gt; — MCP server for LLM agents (programmatic, for agents)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;girb-ruby_llm&lt;/strong&gt; — LLM provider via ruby_llm&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;girb-gemini&lt;/strong&gt; — LLM provider via Gemini API&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Feedback Welcome
&lt;/h2&gt;

&lt;p&gt;girb-mcp is still a work in progress. If you try it out and notice anything, please let me know!&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;GitHub Issues: &lt;a href="https://github.com/rira100000000/girb-mcp/issues" rel="noopener noreferrer"&gt;https://github.com/rira100000000/girb-mcp/issues&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Any feedback is welcome — whether it's "this part is hard to use" or "I'd love to see this feature"!&lt;/p&gt;

</description>
      <category>agents</category>
      <category>mcp</category>
      <category>ruby</category>
      <category>showdev</category>
    </item>
  </channel>
</rss>
