Class: CovLoupe::MCPServer
- Inherits:
-
Object
- Object
- CovLoupe::MCPServer
- Defined in:
- lib/cov_loupe/mcp_server.rb
Constant Summary collapse
- TOOLSET =
Tool classes registered with the MCP server. Order determines listing in help output. File-scope tools require a
pathargument; project-scope tools do not. [ Tools::ProjectCoverageTool, Tools::FileCoverageDetailedTool, Tools::FileCoverageRawTool, Tools::FileCoverageSummaryTool, Tools::ProjectCoverageTotalsTool, Tools::FileUncoveredLinesTool, Tools::ProjectValidateTool, Tools::HelpTool, Tools::VersionTool, ].freeze
Instance Attribute Summary collapse
-
#context ⇒ Object
readonly
Returns the value of attribute context.
Instance Method Summary collapse
-
#initialize(context: CovLoupe.context) ⇒ MCPServer
constructor
A new instance of MCPServer.
- #run ⇒ Object
-
#toolset ⇒ Object
Expose the registered tools so embedders can introspect without booting the server.
Constructor Details
Instance Attribute Details
#context ⇒ Object (readonly)
Returns the value of attribute context.
52 53 54 |
# File 'lib/cov_loupe/mcp_server.rb', line 52 def context @context end |
Instance Method Details
#run ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/cov_loupe/mcp_server.rb', line 20 def run CovLoupe.with_context(context) do server = ::MCP::Server.new( name: 'cov-loupe', version: CovLoupe::VERSION, tools: toolset, instructions: instructions, server_context: context ) ::MCP::Server::Transports::StdioTransport.new(server).open end end |
#toolset ⇒ Object
Expose the registered tools so embedders can introspect without booting the server.
48 49 50 |
# File 'lib/cov_loupe/mcp_server.rb', line 48 def toolset TOOLSET end |