Class: RuboCop::MCP::Server Private

Inherits:
Object
  • Object
show all
Defined in:
lib/rubocop/mcp/server.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

RuboCop MCP Server.

Instance Method Summary collapse

Constructor Details

#initialize(config_store) ⇒ Server

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Server.



12
13
14
15
16
# File 'lib/rubocop/mcp/server.rb', line 12

def initialize(config_store)
  @config_store = config_store
  @runtime = RuboCop::LSP::Runtime.new(@config_store)
  @options = {}
end

Instance Method Details

#startObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



18
19
20
21
22
23
24
25
26
27
# File 'lib/rubocop/mcp/server.rb', line 18

def start
  # No `protocol_version` is specified because draft feature by default can be used.
  server = ::MCP::Server.new(
    name: 'rubocop_mcp_server',
    version: RuboCop::Version::STRING,
    tools: [inspection_tool, autocorrection_tool]
  )

  ::MCP::Server::Transports::StdioTransport.new(server).open
end