Ruby MCP server generator
Generate a production-ready Ruby MCP server project from bundled templates, preserving Ruby naming conventions, SDK structure, schemas, annotations, error handling, tests, and both stdio and HTTP usage examples.
When to invoke
- "Generate a Ruby MCP server project."
- "Scaffold an MCP server in Ruby with tools and prompts."
- "Create a Ruby server using the official MCP SDK gem."
- "Add tests and schemas to a Ruby MCP server template."
Request parameters
Ask for project name and description when missing. Convert the project name into snake_case file/module paths and a Ruby module name before generating files.
Project structure
Generate this complete tree, adapting my-mcp-server and my_mcp_server to the user's project name:
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
Generation rules
| Area |
Rule |
| Templates |
Open references/project-templates.md and copy/adapt the full templates verbatim before inventing structure. |
| Tools and prompts |
Use classes for tools and prompts for better organization. |
| Schemas |
Include input/output schemas for type safety. |
| Annotations |
Add tool annotations that describe behavior and safety hints. |
| Responses |
Include structured content in responses, not only plain text. |
| Errors |
Return proper error responses with an is_error flag. |
| Tests |
Implement comprehensive tests for all tools, including success and error paths. |
| Ruby conventions |
Use snake_case, modules, and frozen_string_literal. |
| Usage |
Provide both stdio and HTTP examples in README.md. |
Procedure
- Collect project name and description if the user did not provide them.
- Normalize names for directory, executable, file paths, and Ruby module constants.
- Read
references/project-templates.md and adapt every required file in the project tree.
- Generate all files with correct naming, module nesting, SDK setup, tools, prompts, resources, and executable entry point.
- Add input/output schemas, tool annotations, structured responses,
is_error error handling, and tests.
- Validate with the existing Ruby test command if dependencies are available; otherwise report the exact command the user should run.
Progressive disclosure and bundled resources
references/project-templates.md: canonical Ruby MCP server project templates; read it before creating project files and copy/adapt the templates verbatim.
Gotchas
- Do not generate only a single server file: the skill requires a complete project tree with tests and README.
- Do not skip schemas: MCP clients depend on clear input/output contracts.
- Do not use ad hoc hashes for everything: classes and modules keep tools, prompts, and resources maintainable.
Output template
### Ruby MCP server generation
**Status:** complete | needs input | blocked
**Project:** `<my-mcp-server>`
**Module:** `<MyMcpServer>`
| Artifact | Path | Notes |
| --- | --- | --- |
| Gemfile | `<project>/Gemfile` | official MCP Ruby SDK gem |
| Server | `<project>/lib/<name>/server.rb` | tools/prompts/resources registered |
| Tools | `<project>/lib/<name>/tools/*.rb` | schemas, annotations, structured content |
| Tests | `<project>/test/tools/*_test.rb` | success and error paths |
| README | `<project>/README.md` | stdio and HTTP usage examples |
**Validation**
- `<ruby test command>`: pass | fail | not run
Quality gate
1---2name: ruby-mcp-server-generator3description: Generate a complete Ruby Model Context Protocol server project using the official MCP Ruby SDK gem. Use when the user asks to create or scaffold a Ruby MCP server with tools, prompts, resources, schemas, annotations, structured content responses, tests, stdio usage, and HTTP usage examples.4---56<!-- Generated from harness/github-copilot/skills/ruby-mcp-server-generator/SKILL.md by harness/claude-code/scripts/convert_from_copilot.py. Edit the source, not this file. -->78# Ruby MCP server generator910Generate a production-ready Ruby MCP server project from bundled templates, preserving Ruby naming conventions, SDK structure, schemas, annotations, error handling, tests, and both stdio and HTTP usage examples.1112## When to invoke1314- "Generate a Ruby MCP server project."15- "Scaffold an MCP server in Ruby with tools and prompts."16- "Create a Ruby server using the official MCP SDK gem."17- "Add tests and schemas to a Ruby MCP server template."1819## Request parameters2021Ask for project name and description when missing. Convert the project name into snake_case file/module paths and a Ruby module name before generating files.2223## Project structure2425Generate this complete tree, adapting `my-mcp-server` and `my_mcp_server` to the user's project name:2627```text28my-mcp-server/29├── Gemfile30├── Rakefile31├── lib/32│ ├── my_mcp_server.rb33│ ├── my_mcp_server/34│ │ ├── server.rb35│ │ ├── tools/36│ │ │ ├── greet_tool.rb37│ │ │ └── calculate_tool.rb38│ │ ├── prompts/39│ │ │ └── code_review_prompt.rb40│ │ └── resources/41│ │ └── example_resource.rb42├── bin/43│ └── mcp-server44├── test/45│ ├── test_helper.rb46│ └── tools/47│ ├── greet_tool_test.rb48│ └── calculate_tool_test.rb49└── README.md50```5152## Generation rules5354| Area | Rule |55| --- | --- |56| Templates | Open `references/project-templates.md` and copy/adapt the full templates verbatim before inventing structure. |57| Tools and prompts | Use classes for tools and prompts for better organization. |58| Schemas | Include input/output schemas for type safety. |59| Annotations | Add tool annotations that describe behavior and safety hints. |60| Responses | Include structured content in responses, not only plain text. |61| Errors | Return proper error responses with an `is_error` flag. |62| Tests | Implement comprehensive tests for all tools, including success and error paths. |63| Ruby conventions | Use `snake_case`, modules, and `frozen_string_literal`. |64| Usage | Provide both stdio and HTTP examples in `README.md`. |6566## Procedure67681. Collect project name and description if the user did not provide them.692. Normalize names for directory, executable, file paths, and Ruby module constants.703. Read `references/project-templates.md` and adapt every required file in the project tree.714. Generate all files with correct naming, module nesting, SDK setup, tools, prompts, resources, and executable entry point.725. Add input/output schemas, tool annotations, structured responses, `is_error` error handling, and tests.736. Validate with the existing Ruby test command if dependencies are available; otherwise report the exact command the user should run.7475## Progressive disclosure and bundled resources7677- `references/project-templates.md`: canonical Ruby MCP server project templates; read it before creating project files and copy/adapt the templates verbatim.7879## Gotchas8081- **Do not generate only a single server file**: the skill requires a complete project tree with tests and README.82- **Do not skip schemas**: MCP clients depend on clear input/output contracts.83- **Do not use ad hoc hashes for everything**: classes and modules keep tools, prompts, and resources maintainable.8485## Output template8687```markdown88### Ruby MCP server generation8990**Status:** complete | needs input | blocked91**Project:** `<my-mcp-server>`92**Module:** `<MyMcpServer>`9394| Artifact | Path | Notes |95| --- | --- | --- |96| Gemfile | `<project>/Gemfile` | official MCP Ruby SDK gem |97| Server | `<project>/lib/<name>/server.rb` | tools/prompts/resources registered |98| Tools | `<project>/lib/<name>/tools/*.rb` | schemas, annotations, structured content |99| Tests | `<project>/test/tools/*_test.rb` | success and error paths |100| README | `<project>/README.md` | stdio and HTTP usage examples |101102**Validation**103- `<ruby test command>`: pass | fail | not run104```105106## Quality gate107108- [ ] Project name and description were collected or inferred.109- [ ] `references/project-templates.md` was read before generation.110- [ ] The generated tree includes `Gemfile`, `Rakefile`, `lib/`, `bin/mcp-server`, `test/`, and `README.md`.111- [ ] Tools and prompts are classes with input/output schemas and annotations.112- [ ] Responses include structured content and use `is_error` for error cases.113- [ ] Tests cover all generated tools.114- [ ] Ruby conventions are followed: `snake_case`, modules, and `frozen_string_literal`.115- [ ] README includes both stdio and HTTP usage examples.