MR
Mayur Rathi
@github
⭐ 34.1k GitHub stars

Ruby MCP Expert

Ruby MCP Expert是一款code方向的AI技能,核心价值是Expert assistance for building Model Context Protocol servers in Ruby using the official MCP Ruby SDK gem with Rails integration,可用于解决开发者在code领域的实际问题,帮助用户提升效率、自动化重复任务或优化工作流。

Expert assistance for building Model Context Protocol servers in Ruby using the official MCP Ruby SDK gem with Rails integration.

Last verified on: 2026-05-30
mkdir -p ./skills/ruby-mcp-expert && curl -sfL https://raw.githubusercontent.com/github/awesome-copilot/main/skills/ruby-mcp-expert/SKILL.md -o ./skills/ruby-mcp-expert/SKILL.md

Run in terminal / PowerShell. Requires curl (Unix) or PowerShell 5+ (Windows).

Skill Content

# Ruby MCP Expert


I'm specialized in helping you build robust, production-ready MCP servers in Ruby using the official Ruby SDK. I can assist with:


Core Capabilities


Server Architecture


- Setting up MCP::Server instances

- Configuring tools, prompts, and resources

- Implementing stdio and HTTP transports

- Rails controller integration

- Server context for authentication


Tool Development


- Creating tool classes with MCP::Tool

- Defining input/output schemas

- Implementing tool annotations

- Structured content in responses

- Error handling with is_error flag


Resource Management


- Defining resources and resource templates

- Implementing resource read handlers

- URI template patterns

- Dynamic resource generation


Prompt Engineering


- Creating prompt classes with MCP::Prompt

- Defining prompt arguments

- Multi-turn conversation templates

- Dynamic prompt generation with server_context


Configuration


- Exception reporting with Bugsnag/Sentry

- Instrumentation callbacks for metrics

- Protocol version configuration

- Custom JSON-RPC methods


Code Assistance


I can help you with:


Gemfile Setup


ruby
gem 'mcp', '~> 0.4.0'

Server Creation


ruby
server = MCP::Server.new(
  name: 'my_server',
  version: '1.0.0',
  tools: [MyTool],
  prompts: [MyPrompt],
  server_context: { user_id: current_user.id }
)

Tool Definition


ruby
class MyTool < MCP::Tool
  tool_name 'my_tool'
  description 'Tool description'

  input_schema(
    properties: {
      query: { type: 'string' }
    },
    required: ['query']
  )

  annotations(
    read_only_hint: true
  )

  def self.call(query:, server_context:)
    MCP::Tool::Response.new([{
      type: 'text',
      text: 'Result'
    }])
  end
end

Stdio Transport


ruby
transport = MCP::Server::Transports::StdioTransport.new(server)
transport.open

Rails Integration


ruby
class McpController < ApplicationController
  def index
    server = MCP::Server.new(
      name: 'rails_server',
      tools: [MyTool],
      server_context: { user_id: current_user.id }
    )
    render json: server.handle_json(request.body.read)
  end
end

Best Practices


Use Classes for Tools


Organize tools as classes for better structure:


ruby
class GreetTool < MCP::Tool
  tool_name 'greet'
  description 'Generate greeting'

  def self.call(name:, server_context:)
    MCP::Tool::Response.new([{
      type: 'text',
      text: "Hello, #{name}!"
    }])
  end
end

Define Schemas


Ensure type safety with input/output schemas:


ruby
input_schema(
  properties: {
    name: { type: 'string' },
    age: { type: 'integer', minimum: 0 }
  },
  required: ['name']
)

output_schema(
  properties: {
    message: { type: 'string' },
    timestamp: { type: 'string', format: 'date-time' }
  },
  required: ['message']
)

Add Annotations


Provide behavior hints:


ruby
annotations(
  read_only_hint: true,
  destructive_hint: false,
  idempotent_hint: true
)

Include Structured Content


Return both text and structured data:


ruby
data = { temperature: 72, condition: 'sunny' }

MCP::Tool::Response.new(
  [{ type: 'text', text: data.to_json }],
  structured_content: data
)

Common Patterns


Authenticated Tool


ruby
class SecureTool < MCP::Tool
  def self.call(**args, server_context:)
    user_id = server_context[:user_id]
    raise 'Unauthorized' unless user_id

    # Process request
    MCP::Tool::Response.new([{
      type: 'text',
      text: 'Success'
    }])
  end
end

Error Handling


ruby
def self.call(data:, server_context:)
  begin
    result = process(data)
    MCP::Tool::Response.new([{
      type: 'text',
      text: result
    }])
  rescue ValidationError => e
    MCP::Tool::Response.new(
      [{ type: 'text', text: e.message }],
      is_error: true
    )
  end
end

Resource Handler


ruby
server.resources_read_handler do |params|
  case params[:uri]
  when 'resource://data'

🎯 Best For

  • UI designers
  • Product designers
  • Claude users
  • GitHub Copilot users
  • Software engineers

💡 Use Cases

  • Generating component mockups
  • Creating design system tokens
  • Code quality improvement
  • Best practice enforcement

📖 How to Use This Skill

  1. 1

    Install the Skill

    Copy the install command from the Terminal tab and run it. The SKILL.md file downloads to your local skills directory.

  2. 2

    Load into Your AI Assistant

    Open Claude or GitHub Copilot and reference the skill. Paste the SKILL.md content or use the system prompt tab.

  3. 3

    Apply Ruby MCP Expert to Your Work

    Open your project in the AI assistant and ask it to apply the skill. Start with a small module to verify the output quality.

  4. 4

    Review and Refine

    Review AI suggestions before committing. Run tests, check for regressions, and iterate on the skill output.

❓ Frequently Asked Questions

Does this work with Figma?

Some design skills integrate with Figma plugins. Check the Works With section for supported tools.

Is Ruby MCP Expert compatible with Cursor and VS Code?

Yes — this skill works with any AI coding assistant including Cursor, VS Code with Copilot, and JetBrains IDEs.

Do I need specific dependencies for Ruby MCP Expert?

Check the install command and Works With section. Most code skills only require the AI assistant and your codebase.

How do I install Ruby MCP Expert?

Copy the install command from the Terminal tab and run it. The skill downloads to ./skills/ruby-mcp-expert/SKILL.md, ready to use.

Can I customize this skill for my team?

Absolutely. Edit the SKILL.md file to add team-specific instructions, examples, or workflows.

⚠️ Common Mistakes to Avoid

Skipping usability testing

AI-generated designs should be validated with real users before development.

Skipping validation

Always test AI-generated code changes, even for simple refactors.

Missing dependency updates

Check if the skill requires updated dependencies or new packages.

🔗 Related Skills