Module: Ask::WebSearch::MCP
- Defined in:
- lib/ask/web_search/mcp.rb,
lib/ask/web_search/mcp/tool.rb,
lib/ask/web_search/mcp/version.rb
Defined Under Namespace
Classes: Tool
Constant Summary collapse
- VERSION =
"0.4.1"
Class Method Summary collapse
-
.start ⇒ Object
Start the MCP server over stdio, exposing the ask_web_search tool.
-
.tool ⇒ Object
Builds the tool exposed over MCP.
Class Method Details
.start ⇒ Object
Start the MCP server over stdio, exposing the ask_web_search tool.
$ ask-web-search-mcp
The server will listen for JSON-RPC messages on stdin and write responses to stdout — the standard MCP stdio transport. Register this executable as an MCP server in your client configuration:
"mcp": {
"servers": {
"ask-web-search-mcp": {
"type": "stdio",
"command": "ask-web-search-mcp",
"args": []
}
}
}
36 37 38 39 40 41 42 43 44 |
# File 'lib/ask/web_search/mcp.rb', line 36 def self.start Ask::MCP::Server.start_stdio( name: "ask-web-search-mcp", version: VERSION, tools: [tool], capabilities: { tools: {} }, debug: ENV["DEBUG"] == "1" ) end |
.tool ⇒ Object
Builds the tool exposed over MCP. The tool framing lives here — ask-web-search is a library (Ask::WebSearch.search); this server owns the agent-facing shell, named "ask_web_search" to avoid collisions with client-side tools of the same name.
15 16 17 |
# File 'lib/ask/web_search/mcp.rb', line 15 def self.tool Tool.new end |