Ruby MCP Client

v1.0.0Developer Toolsstable

This is a Ruby implementation of MCP (Model Context Protocol) client

ruby-mcp-clientmcpai-integration
Share:
103
Stars
0
Downloads
0
Weekly
0/5

What is Ruby MCP Client?

Ruby MCP Client is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to this is a ruby implementation of mcp (model context protocol) client

This is a Ruby implementation of MCP (Model Context Protocol) client

This server falls under the Developer Tools category on MCPgee, the world's largest MCP server directory with 33,000+ servers.

Features

  • This is a Ruby implementation of MCP (Model Context Protocol

Use Cases

Implement Ruby-based MCP client for connecting to MCP servers. Build Ruby applications that leverage Model Context Protocol.
simonx1

Maintainer

LicenseMIT
Languageruby
Versionv1.0.0
UpdatedMay 21, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx ruby-mcp-client

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

How to Set Up and Use Ruby MCP Client

ruby-mcp-client is a Ruby gem that implements the Model Context Protocol client specification, allowing Ruby applications to connect to any MCP server and use its tools, prompts, and resources. It supports all four MCP transports — stdio, SSE, HTTP, and streamable HTTP — and integrates directly with OpenAI and Anthropic SDKs, making it straightforward to build Ruby-based AI agents that call MCP tools. Developers building Ruby on Rails applications or standalone Ruby scripts can use this library to add MCP-powered capabilities without needing a separate Node.js or Python runtime.

Prerequisites

  • Ruby 3.0 or later
  • Bundler installed for gem management
  • An OpenAI API key (OPENAI_API_KEY) or Anthropic API key (ANTHROPIC_API_KEY) if integrating with LLM providers
  • At least one running MCP server to connect to (e.g., npx -y @modelcontextprotocol/server-filesystem)
1

Add the gem to your Gemfile

Add ruby-mcp-client to your project's Gemfile and run bundle install.

# In your Gemfile
gem 'ruby-mcp-client'

# Then install
bundle install
2

Or install the gem directly

For standalone scripts or quick experiments, install the gem globally.

gem install ruby-mcp-client
3

Connect to an MCP server via stdio

Use MCPClient.connect to spin up a stdio-based MCP server and get a connected client in one call.

require 'mcp_client'

client = MCPClient.connect('npx -y @modelcontextprotocol/server-filesystem .')
tools = client.list_tools
puts tools.map(&:name)
4

Connect to an HTTP-based MCP server

For SSE or streamable HTTP transports, pass the server URL directly.

client = MCPClient.connect('http://localhost:8931/mcp')
result = client.call_tool('tool_name', { param: 'value' })
puts result
5

Integrate with OpenAI

Convert MCP tools to OpenAI function-calling format in one step for use with the openai gem.

require 'mcp_client'
require 'openai'

mcp = MCPClient.connect('npx -y @modelcontextprotocol/server-filesystem .')
openai_tools = mcp.to_openai_tools
# Pass openai_tools to your OpenAI chat completion call

Ruby MCP Client Examples

Client configuration

Ruby code snippet that connects to a filesystem MCP server and lists available tools.

{
  "mcpServers": {
    "filesystem": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-filesystem", "/home"]
    }
  }
}

Prompts to try

Example Ruby operations you can run with the client once connected to an MCP server.

- Connect to a filesystem server and list all tools: client.list_tools
- Call a specific tool: client.call_tool('read_file', { path: '/home/user/notes.txt' })
- Discover available prompts: client.list_prompts
- Read a resource: client.read_resource('file:///home/user/config.json')
- Convert tools to OpenAI format: mcp.to_openai_tools

Troubleshooting Ruby MCP Client

MCPClient.connect raises 'command not found' for npx-based servers

Make sure Node.js and npm are installed and 'npx' is on your PATH. Test with 'which npx' in your terminal before calling MCPClient.connect.

Connection times out when using HTTP transport

Verify the MCP server is running and listening on the specified URL. For SSE transport, ensure the server endpoint is reachable with a simple curl before connecting from Ruby.

OAuth 2.1 authentication errors with protected MCP servers

The gem supports PKCE-based OAuth 2.1. Pass the authorization URL and scopes in the connection headers option. Check the gem's README examples for the correct headers format.

Frequently Asked Questions about Ruby MCP Client

What is Ruby MCP Client?

Ruby MCP Client is a Model Context Protocol (MCP) server that this is a ruby implementation of mcp (model context protocol) client It connects AI assistants to external tools and data sources through a standardized interface.

How do I install Ruby MCP Client?

Follow the installation instructions on the Ruby MCP Client GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.

Which AI clients work with Ruby MCP Client?

Ruby MCP Client works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.

Is Ruby MCP Client free to use?

Yes, Ruby MCP Client is open source and available under the MIT license. You can use it freely in both personal and commercial projects.

Browse More Developer Tools MCP Servers

Explore all developer tools servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.

Quick Config Preview

{ "mcpServers": { "ruby-mcp-client": { "command": "npx", "args": ["-y", "ruby-mcp-client"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

Ready to use Ruby MCP Client?

Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.

33,000+ ServersFree & Open SourceStep-by-Step Guides