Module: Ask::MCP
- Defined in:
- lib/ask/mcp.rb,
lib/ask/mcp/tool.rb,
lib/ask/mcp/client.rb,
lib/ask/mcp/prompt.rb,
lib/ask/mcp/server.rb,
lib/ask/mcp/version.rb,
lib/ask/mcp/resource.rb,
lib/ask/mcp/validator.rb,
lib/ask/mcp/auth/oauth.rb,
lib/ask/mcp/auth/token.rb,
lib/ask/mcp/server/stdio.rb,
lib/ask/mcp/x_mcp_header.rb,
lib/ask/mcp/trace_context.rb,
lib/ask/mcp/transport/sse.rb,
lib/ask/mcp/native/messages.rb,
lib/ask/mcp/transport/stdio.rb,
lib/ask/mcp/adapters/ask_tool.rb,
lib/ask/mcp/adapters/tool_server.rb,
lib/ask/mcp/transport/streamable_http.rb,
lib/ask/mcp/auth/client_id_metadata_document.rb
Defined Under Namespace
Modules: Adapters, Auth, Native, TraceContext, Transport, XMcpHeader Classes: AuthError, Client, ConnectionError, Error, Prompt, ProtocolError, Resource, Server, Tool, ValidationError, Validator
Constant Summary collapse
- PROTOCOL_VERSION =
The MCP protocol revision this gem implements and advertises. Single source of truth — Client and Server::Stdio both reference this so the advertised version can never drift between the two sides.
PROTOCOL_VERSIONis the legacy default (statefulinitializehandshake).SUPPORTED_PROTOCOL_VERSIONSis what the server advertises viaserver/discover;LATEST_PROTOCOL_VERSIONis the stateless 2026-07-28 revision that clients and servers negotiate to. "2025-06-18"- LATEST_PROTOCOL_VERSION =
"2026-07-28"- SUPPORTED_PROTOCOL_VERSIONS =
[PROTOCOL_VERSION, "2025-11-25", LATEST_PROTOCOL_VERSION].freeze
- VERSION =
"0.4.2"
Class Method Summary collapse
- .connect(transport, options = {}) ⇒ Object
- .from_http(url, options = {}) ⇒ Object
- .from_sse(url, options = {}) ⇒ Object
- .from_stdio(command, args = [], options = {}) ⇒ Object
-
.validate!(schema, arguments) ⇒ Object
Validate tool arguments against a JSON Schema input schema.
Class Method Details
.connect(transport, options = {}) ⇒ Object
56 57 58 |
# File 'lib/ask/mcp.rb', line 56 def connect(transport, = {}) Client.new(transport, ) end |
.from_http(url, options = {}) ⇒ Object
70 71 72 73 |
# File 'lib/ask/mcp.rb', line 70 def from_http(url, = {}) transport = Transport::StreamableHTTP.new(url, ) Client.new(transport) end |
.from_sse(url, options = {}) ⇒ Object
65 66 67 68 |
# File 'lib/ask/mcp.rb', line 65 def from_sse(url, = {}) transport = Transport::SSE.new(url, ) Client.new(transport) end |