Ruby MCP Client
This is a Ruby implementation of MCP (Model Context Protocol) client
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
Maintainer
Works with
Installation
Manual Installation
npx ruby-mcp-clientConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
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)
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 installOr install the gem directly
For standalone scripts or quick experiments, install the gem globally.
gem install ruby-mcp-clientConnect 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)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 resultIntegrate 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 callRuby 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_toolsTroubleshooting 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.
Ruby MCP Client Alternatives — Similar Developer Tools Servers
Looking for alternatives to Ruby MCP Client? Here are other popular developer tools servers you can use with Claude, Cursor, and VS Code.
Ecc
★ 188.2kThe agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.
Javaguide
★ 155.8kJava 面试 & 后端通用面试指南,覆盖计算机基础、数据库、分布式、高并发、系统设计与 AI 应用开发
Gemini CLI
★ 104.5kA secure MCP server that wraps the Google Gemini CLI, allowing clients to query Gemini models using local OAuth sessions without requiring an API key. It provides tools for model interaction and diagnostics with built-in protection against command in
Awesome MCP Servers
★ 87.3k⭐ Curated list of Model Context Protocol (MCP) servers - tools that extend Claude Desktop, Cursor, Windsurf, and other MCP clients with custom capabilities.
MCP Servers
★ 86.0kModel Context Protocol Servers
CC Switch
★ 77.5kA cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Gemini CLI & Hermes Agent. Only official website: ccswitch.io
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.
Set Up Ruby MCP Client in Your Editor
Choose your AI client for step-by-step setup instructions.
Quick Config Preview
Add this to your claude_desktop_config.json or .cursor/mcp.json
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.