mcp-ruby
The Model Context Protocol is an open standard that enables developers to build secure, two-way connections between their data sources and AI-powered tools. The architecture is straightforward: developers can either expose their data through MCP servers or build AI applications (MCP clients) that connect to these servers.
claude mcp add --transport stdio wilsonsilva-mcp-ruby ruby -S bin/mcp-ruby
How to use
The mcp-ruby server exposes the Model Context Protocol (MCP) integration as a Ruby gem. It provides tooling to define, validate, and interact with model contexts and AI-powered capabilities using Ruby conventions. Typical usage involves requiring the mcp-ruby library in your Ruby project, leveraging the provided rake tasks for development, testing, and documentation, and using the Yard-based documentation for exploring the API surface. This server is designed for Ruby environments where you want strong typing with RBS, static analysis with Steep, and RSpec-tested behavior to ensure secure, two-way connections between your data sources and AI tools.
To get started, install the gem and install dependencies, then use the included rake tasks to test, lint, and release. You can also generate type definitions with RBS and validate them with typeprof and Steep. The repository emphasizes a robust dev workflow, including security audits and documentation generation via Yard.
How to install
Prerequisites:
- Ruby (2.7+ recommended)
- Bundler
- Git
Installation steps:
-
Install the gem from RubyGems: gem install mcp-ruby
-
Install dependencies for development (from the repo):
git clone https://github.com/wilsonsilva/mcp-ruby.git
cd mcp-ruby
bundle install
- Set up the development environment and install the gem locally (optional, for local testing):
bundle exec rake install
- Run development tasks or the bin setup script if provided:
bundle exec rake setup
5) Build and test the gem locally:
```bash
bundle exec rake spec
bundle exec rake rubocop
- Release a new version (if you’re maintaining the gem):
bundle exec rake release[remote]
Note: The README mentions typical development workflows and Rake tasks; adapt these commands based on your local environment and the exact setup of your fork.
Additional notes
Environment and configuration tips:
- RubyGems users should be aware of Gemfile.lock to manage dependency security; use rake bundle:audit:* tasks to keep dependencies safe.
- For type checking, use RBS files with typeprof to generate, and Steep to validate. The README references generating an RBS definition and performing static checks.
- Yard-based documentation can be generated via rake yard; keep YARD docs up to date with code changes.
- If you plan to publish updates, modify version.rb before running release tasks to tag and publish correctly.
- Since this is a Ruby gem, standard Ruby environment variables (e.g., GEM_HOME, BUNDLE_WITHOUT) can influence runtime and bundler behavior. Consider pinning Ruby versions in your CI to ensure compatibility.
- If you encounter issues with dependencies, run the audit tasks (bundle aAudit) to identify insecure or outdated components.
Related MCP Servers
mcp-language
mcp-language-server gives MCP enabled clients access semantic tools like get definition, references, rename, and diagnostics.
obsidian -tools
Add Obsidian integrations like semantic search and custom Templater prompts to Claude or any MCP client.
Gitingest
mcp server for gitingest
Pare
Dev tools, optimized for agents. Structured, token-efficient MCP servers for git, test runners, npm, Docker, and more.
vector_mcp
A server implementation for the Model Context Protocol (MCP) in Ruby.
mcp-json-yaml-toml
A structured data reader and writer like 'jq' and 'yq' for AI Agents