Agent Mesh
Go a2aa2a-protocolagent-meshagentic-aiinferencemcpmeshmesh-networknetwork-securitynetworking-aip2p-network
fix mcp leak
Antonio Ojea7a408a14df2a
diff --git a/cmd/sam-node/mcp.go b/cmd/sam-node/mcp.goindex 862b4b34..73b6d721 100644--- a/cmd/sam-node/mcp.go+++ b/cmd/sam-node/mcp.go@@ -241,6 +241,7 @@ func (n *SamNode) callMCPToolOnce(ctx context.Context, targetPeer peer.ID, toolNif err != nil {return nil, fmt.Errorf("failed to connect client: %w", err)}+ defer func() { _ = session.Close() }()// We don't need to marshall the params, the SDK takes care of it// Passing pre-marshaled []byte triggers encoding/json's base64 which gets rejected