Module: Ask::Ruby::MCP

Defined in:
lib/ask/ruby/mcp.rb,
lib/ask/ruby/mcp/version.rb

Constant Summary collapse

PROTOCOL_VERSION =
"2025-06-18"
VERSION =
"0.1.1"

Class Method Summary collapse

Class Method Details

.reset!Object

Get or clear the cache (useful in tests).



47
48
49
# File 'lib/ask/ruby/mcp.rb', line 47

def reset!
  @tools = nil
end

.startObject

Start the MCP stdio server, serving the project in the current working directory (ask-ruby-harness's app_root).

$ ask-ruby-harness-mcp

The server listens for JSON-RPC messages on stdin and writes responses to stdout — the standard MCP stdio transport. Register this executable as an MCP server in your client configuration:

"mcp": {
"servers": {
  "ask-ruby-harness-mcp": {
    "type": "stdio",
    "command": "ask-ruby-harness-mcp",
    "args": []
  }
}
}


36
37
38
39
40
41
42
43
44
# File 'lib/ask/ruby/mcp.rb', line 36

def start
  Ask::MCP::Server.start_stdio(
    name: "ask-ruby-harness-mcp",
    version: VERSION,
    tools: tools,
    capabilities: { tools: {} },
    debug: ENV["DEBUG"] == "1"
  )
end

.toolsObject

All ask-ruby-harness tools wrapped as MCP tool instances.



14
15
16
# File 'lib/ask/ruby/mcp.rb', line 14

def tools
  @tools ||= Ask::Ruby::Harness::HARNESS_TOOLS.map(&:new)
end