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() CODE_BLOCK: 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() CODE_BLOCK: gem "girb-mcp" CODE_BLOCK: gem "girb-mcp" CODE_BLOCK: gem install girb-mcp CODE_BLOCK: gem install girb-mcp COMMAND_BLOCK: # Script rdbg --open --port=12345 my_script.rb # Or with environment variables RUBY_DEBUG_OPEN=true RUBY_DEBUG_PORT=12345… COMMAND_BLOCK: # Script rdbg --open --port=12345 my_script.rb # Or with environment variables RUBY_DEBUG_OPEN=true RUBY_DEBUG_PORT=12345 CODE_BLOCK: 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. CODE_BLOCK: 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. CODE_BLOCK: 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. COMMAND_BLOCK: # 1. Install gem install girb girb-ruby_llm # 2. Set your API key export GEMINI_API_KEY="your-api-key" # or OPENAI_API_KEY, ANTHROPIC_API_KEY # 3. Create ~/.girbrc ```ruby require 'girb-ruby_llm' Girb.configure do |c| c.provider = Girb::Providers::RubyLlm.new(model: 'gemini-2.5-flash') end COMMAND_BLOCK: # 1. Install gem install girb girb-ruby_llm # 2. Set your API key export GEMINI_API_KEY="your-api-key" # or OPENAI_API_KEY, ANTHROPIC_API_KEY # 3. Create ~/.girbrc ```ruby require 'girb-ruby_llm' Girb.configure do |c| c.provider = Girb::Providers::RubyLlm.new(model: 'gemini-2.5-flash') end COMMAND_BLOCK: Then type a question and press **Ctrl+Space**, or use `qq <question>`
Table of Contents 1.
[Configuration](#1-configuration)
- Common setup for all environments COMMAND_BLOCK: Then type a question and press **Ctrl+Space**, or use `qq <question>`
Table of Contents 1.
[Configuration](#1-configuration)
- Common setup for all environments CODE_BLOCK: 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() CODE_BLOCK: 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() CODE_BLOCK: 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() CODE_BLOCK: gem install girb-mcp CODE_BLOCK: gem install girb-mcp CODE_BLOCK: gem install girb-mcp CODE_BLOCK: { "mcpServers": { "girb-mcp": { "command": "girb-mcp", "args": [] } } } CODE_BLOCK: { "mcpServers": { "girb-mcp": { "command": "girb-mcp", "args": [] } } } CODE_BLOCK: { "mcpServers": { "girb-mcp": { "command": "girb-mcp", "args": [] } } } CODE_BLOCK: { "mcpServers": { "girb-mcp": { "command": "girb-mcp", "args": [] } } } CODE_BLOCK: { "mcpServers": { "girb-mcp": { "command": "girb-mcp", "args": [] } } } CODE_BLOCK: { "mcpServers": { "girb-mcp": { "command": "girb-mcp", "args": [] } } } CODE_BLOCK: rdbg --open --port=12345 my_script.rb CODE_BLOCK: rdbg --open --port=12345 my_script.rb CODE_BLOCK: rdbg --open --port=12345 my_script.rb COMMAND_BLOCK: girb-rails # Equivalent to RUBY_DEBUG_OPEN=true bin/rails server COMMAND_BLOCK: girb-rails # Equivalent to RUBY_DEBUG_OPEN=true bin/rails server COMMAND_BLOCK: girb-rails # Equivalent to RUBY_DEBUG_OPEN=true bin/rails server
- Context Awareness: Understands local variables, instance variables, and runtime state
- Tool Execution: AI autonomously executes code, inspects objects, and reads files
- Autonomous Investigation: AI loops through investigate-execute-analyze cycles
- Multi-environment Support: Works with IRB, Rails console, and debug gem (rdbg)
- Provider Agnostic: Use any LLM (OpenAI, Anthropic, Gemini, Ollama, etc.)
- The debug gem (rdbg --open) exposes a socket on the target Ruby process - girb-mcp connects to that socket using the debug gem's protocol
- Tool calls from the MCP client are translated into debugger commands, and the results are returned
- AI writes the implementation
- AI writes and passes the tests
- Use girb-mcp to actually run the app and verify it behaves as intended - evaluate_code can execute arbitrary Ruby code. 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.
- The debug gem has no authentication. When exposing a debug port via TCP, bind to 127.0.0.1 or otherwise restrict access.
- Do not use in production. This is a tool for development and debugging purposes only. - girb — AI-powered IRB assistant (interactive, for humans) - girb-mcp — MCP server for LLM agents (programmatic, for agents) - girb-ruby_llm — LLM provider via ruby_llm - girb-gemini — LLM provider via Gemini API
- GitHub Issues: https://github.com/rira100000000/girb-mcp/issues