Skip to content

Replace rubydex_mcp server with Ruby implementation#863

Open
st0012 wants to merge 10 commits into
mainfrom
codex/ruby-mcp-server
Open

Replace rubydex_mcp server with Ruby implementation#863
st0012 wants to merge 10 commits into
mainfrom
codex/ruby-mcp-server

Conversation

@st0012

@st0012 st0012 commented Jun 16, 2026

Copy link
Copy Markdown
Member

Summary

Adds a Ruby implementation of rubydex_mcp with a small internal MCP/JSON-RPC protocol layer.

The existing Rust MCP crate and build plumbing are left in place. If this PR is accepted, I'll remove it in a follow up PR.

Parity with the Rust MCP server

Matches the existing Rust MCP server for:

  • tool names and schemas: search_declarations, get_declaration, get_descendants, find_constant_references, get_file_declarations, codebase_stats
  • startup indexing behavior and indexing-in-progress / indexing-failed responses
  • JSON payload shapes, pagination defaults and caps, kind filtering, exact/fuzzy search modes, relative path formatting, declaration details, descendants, file declarations, and stats
  • constant-reference behavior for classes/modules/constants, with methods returning an empty reference list

Manually checked against rust/target/debug/rubydex_mcp using the same fixture and tool calls for the six tools.

Known difference:

  • unresolved partial ancestors are not exposed by the current Ruby API, so the Ruby MCP server only reports resolved ancestors. The manual parity check confirmed this as the expected mismatch.

Follow-up work

  • Remove the Rust MCP implementation in a separate PR.
  • Open a follow-up PR for Bundler integration.

@st0012 st0012 force-pushed the codex/ruby-mcp-server branch 12 times, most recently from f13e11d to 6a9ca41 Compare June 18, 2026 18:41
@st0012 st0012 changed the title Add Ruby MCP server Replace rubydex_mcp server with Ruby implementation Jun 18, 2026
@st0012 st0012 self-assigned this Jun 18, 2026
@st0012 st0012 force-pushed the codex/ruby-mcp-server branch from 6a9ca41 to db9f6ba Compare June 18, 2026 18:57
@st0012 st0012 marked this pull request as ready for review June 18, 2026 21:21
@st0012 st0012 requested a review from a team as a code owner June 18, 2026 21:21
@st0012 st0012 added the enhancement New feature or request label Jun 22, 2026
@st0012 st0012 force-pushed the codex/ruby-mcp-server branch 2 times, most recently from 077eb83 to d88a604 Compare June 22, 2026 19:03
Comment thread exe/rubydex_mcp Outdated
end

begin
option_parser.parse!(ARGV)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW, one of the things I regret in the LSP was using parse! instead of the non-raising version parse. It makes it more difficult to make backwards incompatible changes to accepted flags, even for development related stuff.

Comment thread exe/rubydex_mcp Outdated
Comment thread lib/rubydex/mcp_server.rb Outdated
Comment thread lib/rubydex/mcp_server.rb Outdated
SERVER_INSTRUCTIONS = <<~TEXT
Rubydex provides semantic Ruby code intelligence.

ONLY use these tools for Ruby files (.rb, .rbi, .rbs) -- never for Rust, JavaScript, or other languages.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now I'm wondering if the reference to other language names will make it better or worse at picking up the MCP 😂

Comment thread lib/rubydex/mcp_server.rb Outdated
Comment thread lib/rubydex/mcp_server/protocol.rb
Comment thread lib/rubydex/mcp_server/protocol.rb
Comment thread lib/rubydex/mcp_server/protocol.rb Outdated
Comment thread lib/rubydex/mcp_server/protocol.rb Outdated
Comment thread lib/rubydex/mcp_server/protocol.rb
@st0012 st0012 force-pushed the codex/ruby-mcp-server branch from 39f7b4d to 5e089f5 Compare June 30, 2026 21:50
@st0012 st0012 requested a review from vinistock June 30, 2026 21:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants