Labsco
github logo

ruby-mcp-server-generator

✓ Official36,200

by github · part of github/awesome-copilot

Generate production-ready MCP servers in Ruby using the official SDK with complete project scaffolding. Generates a full project structure with tools, prompts, resources, tests, and configuration files following Ruby conventions Includes input/output schemas, tool annotations, and structured content support for type-safe MCP implementations Provides example tools (greet, calculate), prompts (code review), and resources with comprehensive test coverage using Minitest Supports stdio transport...

🔥🔥🔥🔥✓ VerifiedFreeQuick setup
🧩 One of 7 skills in the github/awesome-copilot package — works on its own, and pairs well with its siblings.

Generate production-ready MCP servers in Ruby using the official SDK with complete project scaffolding. Generates a full project structure with tools, prompts, resources, tests, and configuration files following Ruby conventions Includes input/output schemas, tool annotations, and structured content support for type-safe MCP implementations Provides example tools (greet, calculate), prompts (code review), and resources with comprehensive test coverage using Minitest Supports stdio transport...

Inspect the full instructions your agent will receiveExpand

This is the exact playbook injected into your agent when the skill activates — shown here so you can audit it before installing. You don't need to read it to use the skill.

by github

Generate production-ready MCP servers in Ruby using the official SDK with complete project scaffolding. Generates a full project structure with tools, prompts, resources, tests, and configuration files following Ruby conventions Includes input/output schemas, tool annotations, and structured content support for type-safe MCP implementations Provides example tools (greet, calculate), prompts (code review), and resources with comprehensive test coverage using Minitest Supports stdio transport... npx skills add https://github.com/github/awesome-copilot --skill ruby-mcp-server-generator Download ZIPGitHub36.2k

Ruby MCP Server Generator

Generate a complete, production-ready MCP server in Ruby using the official Ruby SDK.

Project Generation

When asked to create a Ruby MCP server, generate a complete project with this structure:

Copy & paste — that's it
my-mcp-server/
├── Gemfile
├── Rakefile
├── lib/
│ ├── my_mcp_server.rb
│ ├── my_mcp_server/
│ │ ├── server.rb
│ │ ├── tools/
│ │ │ ├── greet_tool.rb
│ │ │ └── calculate_tool.rb
│ │ ├── prompts/
│ │ │ └── code_review_prompt.rb
│ │ └── resources/
│ │ └── example_resource.rb
├── bin/
│ └── mcp-server
├── test/
│ ├── test_helper.rb
│ └── tools/
│ ├── greet_tool_test.rb
│ └── calculate_tool_test.rb
└── README.md

Gemfile Template

Copy & paste — that's it
source 'https://rubygems.org'

gem 'mcp', '~> 0.4.0'

group :development, :test do
 gem 'minitest', '~> 5.0'
 gem 'rake', '~> 13.0'
 gem 'rubocop', '~> 1.50'
end

Rakefile Template

Copy & paste — that's it
require 'rake/testtask'
require 'rubocop/rake_task'

Rake::TestTask.new(:test) do |t|
 t.libs e
 warn "Error: #{e.message}"
 warn e.backtrace.join("\n")
 exit 1
end

Make the file executable:

Copy & paste — that's it
chmod +x bin/mcp-server

test/test_helper.rb Template

Copy & paste — that's it
# frozen_string_literal: true

$LOAD_PATH.unshift File.expand_path('../lib', __dir__)
require 'my_mcp_server'
require 'minitest/autorun'

test/tools/greet_tool_test.rb Template

Copy & paste — that's it
# frozen_string_literal: true

require 'test_helper'

module MyMcpServer
 module Tools
 class GreetToolTest Run the server:

bundle exec bin/mcp-server

Copy & paste — that's it

 Then send JSON-RPC requests:

{"jsonrpc":"2.0","id":"1","method":"ping"} {"jsonrpc":"2.0","id":"2","method":"tools/list"} {"jsonrpc":"2.0","id":"3","method":"tools/call","params":{"name":"greet","arguments":{"name":"Ruby"}}}

Copy & paste — that's it

### Rails Integration

 Add to your Rails controller:

class McpController Run tests:

Copy & paste — that's it
bundle exec rake test

Run linter:

Copy & paste — that's it
bundle exec rake rubocop

Run all checks:

Copy & paste — that's it
bundle exec rake

Integration with Claude Desktop

Add to claude_desktop_config.json:

Copy & paste — that's it
{
 "mcpServers": {
 "my-mcp-server": {
 "command": "bundle",
 "args": ["exec", "bin/mcp-server"],
 "cwd": "/path/to/my-mcp-server"
 }
 }
}

Project Structure

Copy & paste — that's it
my-mcp-server/
├── Gemfile # Dependencies
├── Rakefile # Build tasks
├── lib/ # Source code
│ ├── my_mcp_server.rb # Main entry point
│ └── my_mcp_server/ # Module namespace
│ ├── server.rb # Server setup
│ ├── tools/ # Tool implementations
│ ├── prompts/ # Prompt templates
│ └── resources/ # Resource handlers
├── bin/ # Executables
│ └── mcp-server # Stdio server
├── test/ # Test suite
│ ├── test_helper.rb # Test configuration
│ └── tools/ # Tool tests
└── README.md # This file

License

MIT

Copy & paste — that's it

## Generation Instructions

1. **Ask for project name and description**
2. **Generate all files** with proper naming and module structure
3. **Use classes for tools and prompts** for better organization
4. **Include input/output schemas** for type safety
5. **Add tool annotations** for behavior hints
6. **Include structured content** in responses
7. **Implement comprehensive tests** for all tools
8. **Follow Ruby conventions** (snake_case, modules, frozen_string_literal)
9. **Add proper error handling** with is_error flag
10. **Provide both stdio and HTTP** usage examples