Skip to content

[FEATURE] Ruby adapter #46

@censoredp

Description

@censoredp

🚀 Feature Request

Is your feature request related to a problem?

mcp-debugger supports Python, JavaScript, Go, Java, .NET, and Rust, but not Ruby. Ruby developers debugging with AI agents (Claude Code, Cursor, etc.) currently have no way to drive rdbg through MCP.

Describe the solution you'd like

A first-class adapter-ruby package using Ruby's stdlib debug gem (rdbg), wired into the existing adapter registry and policy pattern — matching the shape of adapter-go / adapter-python.

Describe alternatives you've considered

  • byebug / pry-byebug: no DAP support.
  • ruby-debug-ide: works, but unmaintained and DAP coverage is worse than debug gem's.
  • External bridges (e.g. VS Code's Ruby extension): tied to the VS Code IPC protocol, not reusable in MCP.

💡 Use Case

Debugging a Ruby/Rails test or service under an AI agent, e.g.:

rdbg --open --host=127.0.0.1 --port=12345 bin/rspec_debug spec/some_spec.rb

Then from the agent:

create_debug_session(language: "ruby")
attach_to_process(sessionId, host: "127.0.0.1", port: 12345)
set_breakpoint(...)
continue_execution(...)
evaluate_expression(...)

🔧 Implementation Ideas

  • New package packages/adapter-ruby mirroring the adapter-go layout (src/, package.json, tsconfig.json).
  • New packages/shared/src/interfaces/adapter-policy-ruby.ts with Ruby-specific policy (command resolution for rdbg, attach vs launch semantics, DAP quirks).
  • Minor additions in shared interfaces + adapters/adapter-loader.ts / container/dependencies.ts to register the new adapter. Ideally split into a separate "hooks for Ruby adapter" PR if the core changes are non-trivial.
  • One Ruby-specific gotcha to document: pry-byebug loaded in a project hijacks TracePoint and silently breaks rdbg's line-based breakpoints. Recommended workaround is binding.break if defined?(DEBUGGER__) in source, and a thin bundler+rspec runner for script mode. Worth a paragraph in the adapter README.
  • CI: add a Ruby toolchain (ruby/setup-ruby@v1) to the workflow matrix; rdbg ships with Ruby ≥ 3.1 stdlib debug gem.

📊 Impact

  • Who would benefit: Ruby / Rails developers using AI coding agents.
  • Priority: Medium
  • Complexity: Moderate — adapter itself is straightforward; the cross-cutting shared-interface changes and CI work are the bulk.

🤝 Are you willing to contribute?

  • Yes, I'd like to implement this feature (have a working prototype locally against rdbg)
  • Yes, I'd like to help test it
  • No, but I'm available for questions

📝 Additional Context

Happy to open a draft PR once there's interest. Would appreciate guidance on whether the shared-interface changes should land as a prep PR first, or bundled with the adapter.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions