Module: Mewmew
- Defined in:
- lib/mewmew.rb,
lib/mewmew/version.rb,
lib/mewmew/mcp_integration.rb,
lib/mewmew/thor_introspector.rb
Defined Under Namespace
Modules: ThorMcpExtension Classes: Error, McpIntegration, ThorIntrospector
Constant Summary collapse
- VERSION =
"0.1.1"
Class Method Summary collapse
-
.included(base) ⇒ Object
Auto-detect Thor classes and include MCP functionality.
-
.serve_cli(thor_class, **server_options) ⇒ Object
Convert a Thor CLI class to MCP tools and start a server.
-
.tools_for_cli(thor_class) ⇒ Object
Get MCP tools for a Thor CLI class without starting server.
Class Method Details
.included(base) ⇒ Object
Auto-detect Thor classes and include MCP functionality
11 12 13 14 15 16 |
# File 'lib/mewmew.rb', line 11 def self.included(base) # Check if the base class is a Thor class by looking for Thor inheritance if thor_class?(base) base.include(Mewmew::ThorMcpExtension) end end |
.serve_cli(thor_class, **server_options) ⇒ Object
Convert a Thor CLI class to MCP tools and start a server
20 21 22 |
# File 'lib/mewmew.rb', line 20 def serve_cli(thor_class, **) McpIntegration.new(thor_class, **).serve end |
.tools_for_cli(thor_class) ⇒ Object
Get MCP tools for a Thor CLI class without starting server
25 26 27 |
# File 'lib/mewmew.rb', line 25 def tools_for_cli(thor_class) ThorIntrospector.new(thor_class).to_mcp_tools end |