Skip to content

difference between python-sdk and ruby-sdk in a fast-agent #143

@dmlond

Description

@dmlond

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:

  1. install python and ruby
  2. create mcp directory
  3. add pcalc.py
  4. add rcalc.rb
  5. Initialize a fast-agent and configure it to use stdio rcalc and pcalc
  6. run fast-agent go --servers pcalc
  7. run fast-agent go --servers rcalc
  8. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions