1. Conduid
  2. AI
  3. On Ruby
MCP server Β· AI

On Ruby

πŸ’Ž A Ruby implementation of the Model Context Protocol

62Good

Scored 6 days ago Β· breakdown

About On Ruby

On Ruby is an MCP server published by nagstler in the AI category: πŸ’Ž A Ruby implementation of the Model Context Protocol.

The repository has 97 stars and 8 forks, with the last commit 4 months ago. Recent commit activity is the strongest signal that reported issues will get attention.

Install

From source
git clone https://github.com/nagstler/mcp_on_ruby

This server has no ConduID identity, so agent calls to it are not receipted. Pin the version you install and review the source before granting it credentials.

Ask AI

✦

Ask AI about On Ruby

Powered by Claude · Grounded in docs

I know everything about On Ruby. Ask me about installation, configuration, usage, or troubleshooting.

Security checks

Static checks derived from the repository 4 hours ago. Heuristics on the source, not an audit.

  • βœ“README presentThe repository ships documentation.
  • βœ“License declaredUsable under a stated license.
  • βœ“Tests presentA test suite exists in the repository.
  • βœ“Dependencies pinnedA lockfile pins dependency versions.
  • βœ“No dynamic code executionSource scan found no eval, dynamic Function, or shell execution.
  • !Scoped permissionsDoesn't declare a permission scope. Assume it can do anything its process can.

Releases

v1.0.0v1.0.0

README

MCP on Ruby

Gem Version Ruby Version

Model Context Protocol (MCP) server for Rails applications

Expose your Rails app as an AI accessible interface β€” define tools and resources the Rails way.

MCP


Features

πŸš€ Production-Ready - Authentication, rate limiting, error handling, security
πŸ”§ Rails Integration - Generators, autoloading, middleware, Railtie
πŸ› οΈ Tools System - Callable functions with JSON Schema validation
πŸ“Š Resources System - Data exposure with URI templating
πŸ”’ Security - DNS rebinding protection, CORS, token authentication
⚑ Real-time - Server Events (SSE) foundation (full implementation coming soon)
🎯 Developer-Friendly - Clean DSL, generators, testing support

Installation

Add to your Gemfile:

gem 'mcp_on_ruby'

Then run:

bundle install
rails generate mcp_on_ruby:install

Quick Start

1. Install and Configure

# Generate MCP server files
rails generate mcp_on_ruby:install

# Create a tool
rails generate mcp_on_ruby:tool UserManager --description "Manage application users"

# Create a resource  
rails generate mcp_on_ruby:resource UserStats --uri "users/{id}/stats" --template

2. Configure MCP Server

# config/initializers/mcp_on_ruby.rb
McpOnRuby.configure do |config|
  config.authentication_required = true
  config.authentication_token = ENV['MCP_AUTH_TOKEN']
  config.rate_limit_per_minute = 60
  config.allowed_origins = [/\.yourdomain\.com$/]
end

Rails.application.configure do
  config.mcp.enabled = true
  config.mcp.auto_register_tools = true
  config.mcp.auto_register_resources = true
end

3. Create Tools

# app/tools/user_manager_tool.rb
class UserManagerTool < ApplicationTool
  def initialize
    super(
      name: 'user_manager',
      description: 'Manage application users',
      input_schema: {
        type: 'object',
        properties: {
          action: { type: 'string', enum: ['create', 'update', 'delete'] },
          user_id: { type: 'integer' },
          attributes: { type: 'object' }
        },
        required: ['action']
      }
    )
  end

  protected

  def execute(arguments, context)
    case arguments['action']
    when 'create'
      user = User.create!(arguments['attributes'])
      { success: true, user: user.as_json }
    when 'update'
      user = User.find(arguments['user_id'])
      user.update!(arguments['attributes'])
      { success: true, user: user.as_json }
    else
      { error: 'Unsupported action' }
    end
  end

  def authorize(context)
    # Add your authorization logic
    context[:authenticated] == true
  end
end

4. Create Resources

# app/resources/user_stats_resource.rb
class UserStatsResource < ApplicationResource
  def initialize
    super(
      uri: 'users/{id}/stats',
      name: 'User Statistics',
      description: 'Get detailed user statistics',
      mime_type: 'application/json'
    )
  end

  protected

  def fetch_content(params, context)
    user = User.find(params['id'])
    
    {
      user_id: user.id,
      statistics: {
        posts_count: user.posts.count,
        comments_count: user.comments.count,
        last_login: user.last_login_at,
        account_created: user.created_at
      },
      generated_at: Time.current.iso8601
    }
  end

  def authorize(context)
    # Check if user can access this data
    context[:authenticated] == true
  end
end

5. Start Your Server

rails server
# MCP server available at http://localhost:3000/mcp

Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                        Rails App                            β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚  app/tools/          β”‚  app/resources/                      β”‚
β”‚  β”œβ”€β”€ application_tool.rb     β”œβ”€β”€ application_resource.rb    β”‚
β”‚  β”œβ”€β”€ user_manager_tool.rb    β”œβ”€β”€ user_stats_resource.rb     β”‚
β”‚  └── ...                     └── ...                        β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                    MCP Server Core                          β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
β”‚  β”‚     Tools       β”‚ β”‚    Resources    β”‚ β”‚  Transport   β”‚   β”‚
β”‚  β”‚  - Validation   β”‚ β”‚  - Templating   β”‚ β”‚  - HTTP      β”‚   β”‚
β”‚  β”‚  - Authorizationβ”‚ β”‚  - Authorizationβ”‚ β”‚  - SSE       β”‚   β”‚
β”‚  β”‚  - Execution    β”‚ β”‚  - Content      β”‚ β”‚  - Security  β”‚   β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                  JSON-RPC Protocol                          β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Examples

Connect your Rails MCP server with different AI clients:

πŸ‘‰ Claude Desktop - Complete setup guide with bridge script

πŸ‘‰ MCP registries and control planes - Register the Rails MCP endpoint with an MCP-compatible registry or gateway so tool discovery, access control, audit trails, and approvals can be managed centrally while Rails owns the tools.

Documentation

πŸ‘‰ Advanced Usage - Custom authorization, caching, manual configuration
πŸ‘‰ Testing Guide - RSpec integration and testing patterns
πŸ‘‰ API Reference - Complete API documentation

Requirements

  • Ruby 2.7.0 or higher
  • Rails 6.0 or higher (for full integration)
  • JSON Schema validation support

Dependencies

Production dependencies (minimal footprint):

  • json-schema (~> 3.0) - JSON Schema validation
  • rack (~> 2.2) - HTTP transport layer
  • webrick (~> 1.7) - HTTP server

Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Write tests for your changes
  4. Ensure all tests pass (bundle exec rspec)
  5. Commit your changes (git commit -am 'Add some feature')
  6. Push to the branch (git push origin my-new-feature)
  7. Create a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments

  • The Model Context Protocol team at Anthropic for creating the specification
  • The Ruby on Rails community for inspiration and conventions

Made with ❀️ for the Ruby community

README fetched from the repository 4 hours ago. The original is authoritative.

Questions

About On Ruby

How do I install On Ruby?

No package has been published for this server, so install it from source: clone the repository and follow its README.

Is On Ruby safe to use with an AI agent?

Its trust score is 62 out of 100 (good). It passes 5 of the 6 static security checks run so far; the failures are listed above. It has no ConduID identity yet, so agent calls to it are not receipted.

Is On Ruby still maintained?

Yes β€” the last commit was 4 months ago. The repository has 97 stars and 8 forks.