File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed
Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -6,17 +6,26 @@ class Client
66 #
77 # @param transport [Object] The transport object to use for communication with the server.
88 # The transport should be a duck type that responds to `send_request`. See the README for more details.
9+ # @param client_info [Hash] Information about the client (name and version)
10+ # @param protocol_version [String] The MCP protocol version to use
911 #
1012 # @example
1113 # transport = MCP::Client::HTTP.new(url: "http://localhost:3000")
12- # client = MCP::Client.new(transport: transport)
13- def initialize ( transport :)
14+ # client = MCP::Client.new(
15+ # transport: transport,
16+ # client_info: { name: "my-client", version: "1.0.0" }
17+ # )
18+ def initialize ( transport :, client_info : nil , protocol_version : "2025-06-18" )
1419 @transport = transport
20+ @client_info = client_info || { name : "ruby-mcp-client" , version : MCP ::VERSION }
21+ @protocol_version = protocol_version
22+ @initialized = false
23+ @session_info = nil
1524 end
1625
1726 # The user may want to access additional transport-specific methods/attributes
1827 # So keeping it public
19- attr_reader :transport
28+ attr_reader :transport , :client_info , :protocol_version , :session_info
2029
2130 # Returns the list of tools available from the server.
2231 # Each call will make a new request – the result is not cached.
You can’t perform that action at this time.
0 commit comments