ruby -client
This is a Ruby implementation of MCP (Model Context Protocol) client
claude mcp add --transport http simonx1-ruby-mcp-client https://api.example.com/mcp \ --header "Authorization: Bearer TOKEN"
How to use
The ruby-mcp-client provides a Ruby interface to connect to MCP servers over multiple transports (stdio, SSE, HTTP, and Streamable HTTP) and to perform common MCP operations such as listing tools, invoking tools, and streaming results. It includes built-in conversions to OpenAI, Anthropic, and Google tool formats so you can feed the discovered tools directly into your preferred AI tooling stack. Typical usage involves creating a client that auto-detects the transport from a URL or explicitly selecting a transport, then querying tools and executing actions against those tools. You can also access prompts, resources, and structured outputs, and you can enable server-initiated interactions (elicitation) when supported by the server.
How to install
Prerequisites:
- Ruby installed (2.7+ recommended)
- Bundler available
Installation steps:
- Add the gem to your Gemfile: gem 'ruby-mcp-client'
- Install dependencies:
bundle install
or install the gem directly
gem install ruby-mcp-client
Example minimal usage after installation: require 'mcp_client'
Create a client (auto-detects transport from URL)
client = MCPClient.connect('http://localhost:8000/sse')
Or connect to a streamable HTTP endpoint with auth headers
client = MCPClient.connect('https://api.example.com/mcp', headers: { 'Authorization' => 'Bearer TOKEN' })
Interact with the MCP server
tools = client.list_tools result = client.call_tool('tool_name', { param: 'value' }) client.cleanup
Additional notes
Notes:
- The README example servers include a filesystem stdio server (npx) and a streamable HTTP API endpoint. You can customize the filesystem root, API base URL, and headers as needed.
- Transport detection supports SSE, Streamable HTTP, and stdio; you can force a specific transport if required.
- If you use stdio, ensure the referenced command is available in your environment (e.g., npx with the @modelcontextprotocol/server-filesystem package).
- The MCP 2025-11-25 features cover Tool Prompts, Resources, Elicitation, Roots, Sampling, Completion, Logging, and more. Leverage these features via the Ruby client to build robust tool integrations and AI workflows.
- Environment variables (e.g., AUTH tokens, API keys) should be provided through the headers option or your environment management strategy.
- When using streaming (SSE/Streamable HTTP), handle chunks or events as they arrive and design your UI/update loop accordingly.
Related MCP Servers
fast
A Ruby Implementation of the Model Context Protocol
rails
A Ruby gem implementation of a Model Context Protocol (MCP) server for Rails projects. This server allows LLMs (Large Language Models) to interact with Rails projects through the Model Context Protocol.
mcp-rb
A lightweight Ruby framework for building MCP servers with a Sinatra-like DSL
sketchup
Sketchup Model Context Protocol
rails-pg-extras
MCP (Model Context Protocol) LLM interface for rails-pg-extras gem
nvim
A Ruby implementation of the MCP server protocol for Neovim