Merge pull request #133 from koic/add_connect_to_stdio_client
Add client-level connect handshake to stdio transport
This commit is contained in:
commit
7ce3b10829
2 changed files with 2 additions and 1 deletions
|
|
@ -5,4 +5,4 @@ source "https://rubygems.org"
|
||||||
gem "anthropic"
|
gem "anthropic"
|
||||||
gem "base64"
|
gem "base64"
|
||||||
gem "dotenv"
|
gem "dotenv"
|
||||||
gem "mcp", '>= 0.9.1'
|
gem "mcp", '>= 0.15.0'
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,7 @@ class MCPClient
|
||||||
|
|
||||||
@transport = MCP::Client::Stdio.new(command: command, args: [server_script_path])
|
@transport = MCP::Client::Stdio.new(command: command, args: [server_script_path])
|
||||||
@mcp_client = MCP::Client.new(transport: @transport)
|
@mcp_client = MCP::Client.new(transport: @transport)
|
||||||
|
@mcp_client.connect
|
||||||
|
|
||||||
tool_names = @mcp_client.tools.map(&:name)
|
tool_names = @mcp_client.tools.map(&:name)
|
||||||
puts "\nConnected to server with tools: #{tool_names}"
|
puts "\nConnected to server with tools: #{tool_names}"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue