-
Notifications
You must be signed in to change notification settings - Fork 80
Description
Describe the bug
I am trying to use a ruby-sdk stdio server in a fastagent agent. I have a python-sdk implementation and a ruby-sdk implementation. Both can be run at the commandline and I can send ping jsonrpc requests to them. Only the python implementation works in fastagent.
To Reproduce
Steps to reproduce the behavior:
- install python and ruby
- create mcp directory
- add pcalc.py
- add rcalc.rb
- Initialize a fast-agent and configure it to use stdio rcalc and pcalc
- run fast-agent go --servers pcalc
- run fast-agent go --servers rcalc
- create Expected behaviorA clear and concise description of what you expected to happen.LogsIf applicable, add logs to help explain your problem.
I would expect both to work, and the fast-agent to allow me to use both in the same way
Additional context
Add any other context about the problem here.
rcalc
require 'mcp'
require 'mcp/server/transports/stdio_transport'
# Create a simple tool
class ExampleTool < MCP::Tool
description 'A simple example tool that adds two numbers'
input_schema(
properties: {
a: { type: 'number' },
b: { type: 'number' }
},
required: %w[a b]
)
class << self
def call(a:, b:)
MCP::Tool::Response.new([{
type: 'text',
text: "The sum of #{a} and #{b} is #{a + b}"
}])
end
end
end
# Set up the server
server = MCP::Server.new(
name: 'example_server',
version: '1.0.0',
tools: [ExampleTool]
)
# Create and start the transport
transport = MCP::Server::Transports::StdioTransport.new(server)
transport.open
pcalc
require 'mcp'
require 'mcp/server/transports/stdio_transport'
# Create a simple tool
class ExampleTool < MCP::Tool
description 'A simple example tool that adds two numbers'
input_schema(
properties: {
a: { type: 'number' },
b: { type: 'number' }
},
required: %w[a b]
)
class << self
def call(a:, b:)
MCP::Tool::Response.new([{
type: 'text',
text: "The sum of #{a} and #{b} is #{a + b}"
}])
end
end
end
# Set up the server
server = MCP::Server.new(
name: 'example_server',
version: '1.0.0',
tools: [ExampleTool]
)
# Create and start the transport
transport = MCP::Server::Transports::StdioTransport.new(server)
transport.open
When fast-agent go --servers rcalc runs, it experiences an error on initialization and exits
$ fast-agent go --servers rcalc
[fast_agent.mcp.mcp_agent_client_session] send_request failed: Connection closed
[fast_agent.mcp.mcp_connection_manager] rcalc: Lifecycle task encountered an error: unhandled errors in a TaskGroup (1
sub-exception)
MCP Server Startup Error:
MCP Server: 'rcalc': Failed to initialize - see details. Check fastagent.config.yaml?
Details:
McpError: Connection closed
There was an error starting up the MCP Server.